Indirect variable reference

Jan Schenkel janschenkel at yahoo.com
Wed Jun 11 03:14:01 EDT 2003


--- Howard Bornstein <bornstein at designeq.com> wrote:
> 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?
> 
> TIA,
> 
> Howard Bornstein
> 

Hi Howard,

Try the do command :
  do ("put i into" && value(theList))

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com



More information about the use-livecode mailing list