Using a variable for an array name

Bob Sneidar bobsneidar at
Wed Feb 1 19:03:43 EST 2017

This is called macro substitution in other languages. You would use the form array&tvar in Foxpro for instance. LC has no macro Substitution. Instead:

put "put tArray" & tVar & "[temp] into tText" & tVar into tCommand
replace "temp" with quote & "text" & quote in tCommand
do tCommand

bob s

On Feb 1, 2017, at 15:13 , Peter Bogdanoff via use-livecode <use-livecode at<mailto:use-livecode at>> wrote:

I have arrays:

I want to get data from one of them:

put “tArray” & “1” into tVar
put tVar [“Text”] into tText1

tText1 is empty.

Is there a way to get the data from the arrays without doing this kind of thing for each array:

put tArray1 [“Text”] into tText1
put tArray2 [“Text”] into tText2


Peter Bogdanoff

More information about the use-livecode mailing list