Re: Using a variable for an array name

2017-02-02 Thread Sannyasin Brahmanathaswami via use-livecode
Peter: FYI multi-dimensional arrays are awesome. I use to be "scared" of them, but in RevIgniter we have all kinds of things like galleriaShow["options"]["width"]["805] and even more… so I had go understand it. And, on top of this you can have an array "inside" a key/value (where the value is

Re: Using a variable for an array name

2017-02-01 Thread Peter Bogdanoff via use-livecode
OK, I’ll test the two methods when I get the general procedure working. > On Feb 1, 2017, at 7:52 PM, Richard Gaskin via use-livecode > wrote: > > Peter Bogdanoff wrote: > > > Richard, I’ve heard that “do” is slow because it must be compiled > > every time. I am reiterating this possibly hund

Re: Using a variable for an array name

2017-02-01 Thread Richard Gaskin via use-livecode
Peter Bogdanoff wrote: > Richard, I’ve heard that “do” is slow because it must be compiled > every time. I am reiterating this possibly hundreds of times, so > it is probably much better to combine the arrays into a Big Array? It'll be a little faster, and to my eye much more readable. "Do" is

Re: Using a variable for an array name

2017-02-01 Thread Peter Bogdanoff via use-livecode
Yes, “do” does it. Thank you Ralph and Bob. Richard, I’ve heard that “do” is slow because it must be compiled every time. I am reiterating this possibly hundreds of times, so it is probably much better to combine the arrays into a Big Array? Peter > On Feb 1, 2017, at 7:16 PM, Bob Sneidar via

Re: Using a variable for an array name

2017-02-01 Thread Bob Sneidar via use-livecode
Even better! Bob S On Feb 1, 2017, at 16:08 , Richard Gaskin via use-livecode mailto:use-livecode@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:

Re: Using a variable for an array name

2017-02-01 Thread Richard Gaskin via use-livecode
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

Re: Using a variable for an array name

2017-02-01 Thread Bob Sneidar via use-livecode
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 (untested)

RE: Using a variable for an array name

2017-02-01 Thread Ralph DiMola via use-livecode
...@lists.runrev.com] 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: tArray1 tArray2 tArray3 tArray4 I want to get data from one of them: put “tArr

Using a variable for an array name

2017-02-01 Thread Peter Bogdanoff via use-livecode
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 p