result set database query

Sarah Reichelt sarah.reichelt at gmail.com
Sat Jun 10 20:40:21 EDT 2006


> I get the result set from a query (id and name) these are put into a menu
> (only name showing)
> now when you select a name I want to pass the id that goes with the name to
> a new query
> any ideas how to do this?
>
> 1  bill
> 2 john
> 3 rob
>
> select rob would like to pass 3 to new query

In your example, the ID number is the line number. If this is always
the case then you can use:
  the menuHistory of me
which gives the selected line number for a menu button.

If this is not the case, then you need to store the complet list
somewhere and refer back to it.

get the complete list
sort it the way you want
put it into a custom property
extract the names and put them into the menu

When a menu item is selected:

get the menuHistory of the menu button
find the line number of the custom property
get word 1 of that line to find the ID

HTH,
Sarah



More information about the use-livecode mailing list