Referring to a variable in a roundabout way...

Richard Gaskin ambassador at fourthworld.com
Mon Feb 13 02:09:01 EST 2006


Mark Swindell wrote:
> If a field contains the name of a variable gMyNumber, how can I place 
> something into that variable circuitously, referencing it not directly, 
> but via its name residing in the field?
> 
> Example:
> Put 54 into (variable (word 1 of field 1)), where word 1 of field 1 
> contains the name of a global variable gMyNumber.

When I need variables whose names may also be variable, I use arrays:

   put 54 into MyArray[word 1 of fld 1]

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list