Using a variable for an array name

Ralph DiMola rdimola at
Wed Feb 1 19:07:11 EST 2017

"Do" will do the trick.

Repeat with tVarNum = 1 to 4
 do "put"&&tArray&VarNum&"["&WrapQ("Text")&"] into tText"&tVarNum
 do "put"&&tArray&VarNum&"["&WrapQ("SomeOtherArrayValue")&"] into tSomeOtherArrayValue"&tVarNum
end repeat

function WrapQ pString
 return quote&pString&quote
end WrapQ

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at] On Behalf Of Peter Bogdanoff via use-livecode
Sent: Wednesday, February 01, 2017 6:14 PM
To: How to use LiveCode
Cc: Peter Bogdanoff
Subject: Using a variable for an array name

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

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list