Peter Bogdanoff wrote: > I have arrays: > tArray1 > tArray2 > tArray3 > tArray4 > > 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
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 Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ____________________________________________________________________ ambassa...@fourthworld.com http://www.FourthWorld.com _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode