Indirect variable reference

Monte Goulding monte at sweattechnologies.com
Wed Jun 11 03:14:13 EDT 2003


>
> Is there a way to reference a variable through another variable in
> Transcript?
>
> IOW, I'd like to do something like this:
>
> Repeat with i = 1 to 5
>   put "List"&i into theList
>   put i into value(theList)
> end repeat
>
> The idea is that I construct 5 variables, named list1, list2, list3,
> list4, and list5 in the variable theList. Then I put a value in each of
> these variables through the referencing variable (theList).
>
> The Value function is sort of what I have in mind (it first evaluates the
> expression) but, of course, it doesn't work in this fashion. Is there
> another way to do this (am I missing something obvious) or is this not
> possible in Transcript?
>
>
Hi Howard

I can't solve the problem here but you may get the functionality you want
out of arrays:

repeat with i = 1 to 5
  put whatever into theList[i]
end repeat

Regards

Monte




More information about the use-livecode mailing list