Using a variable for an array name

Bob Sneidar bobsneidar at iotecdigital.com
Wed Feb 1 19:16:53 EST 2017


Even better!

Bob S


On Feb 1, 2017, at 16:08 , Richard Gaskin via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:

Whenever you have a collection of variables whose names may be variable, an array is a natural fit.

LiveCode supports n-dimensional arrays, so you could use:

-- Store:
put "something" into tBigArray["1"]["text"]
put "somethingelse" into tBigArray["2"]["text"]

-- Retrieve:
put tBigArray["1"]["text"] into tSomeVar
put tBigArray["2"]["text"] into tAnotherVar


--
Richard Gaskin




More information about the use-livecode mailing list