Page 1 of 1

Creating Lookups

Posted: Mon May 01, 2017 2:52 pm
by PeterG
Hi Guys
I have been using Alpha Anywhere for a number of years and in the process of getting to know LiveCode. I just want to no what would be the equivalent of a lookup in LC IE:
Looking up a value from another table so that the user can select the record and it would be placed on a field on the current stack. Please correct me if I am wrong. Would one create another stack that will open as a modal so that the user selects a line on a grid component on the modal stack, click a button, the stack closes and the value on the current field is updated.

Thanks
Peter G

Re: Creating Lookups

Posted: Mon May 01, 2017 4:33 pm
by dunbarx
HI.

"Looking up a value..." is simple and direct:

Code: Select all

put line tLine of fld "tField" of cd "tCd" of stack "tStack" into fld yourResultField
Or even a remotely defined chunk expression. That sort of thing. You do not need any intermediate steps, like a modal stack, provided that data is in a stack somewhere. But what you may really be asking is how to know the pathname to the source data if it is in some external file. In that case, look at the "answer folder" and "answer file" commands in the dictionary.

Or I have this totally wrong.

Craig Newman

Re: Creating Lookups

Posted: Wed May 03, 2017 11:55 am
by PeterG
Hi Craig
Thanks for the help.
I have a lot to learn.

Many Thanks
Peter G

Re: Creating Lookups

Posted: Wed May 03, 2017 3:11 pm
by dunbarx
Which way were you thinking? Some stack somewhere, or some file somewhere?

Craig