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

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

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 > wrote: Whenever you have a collection of variables whose names may be variable, an array is a natural fit. LiveCode supports n-dimensional

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 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) bob

RE: Using a variable for an array name

2017-02-01 Thread Ralph DiMola via use-livecode
"Do" will do the trick. Repeat with tVarNum = 1 to 4 do "put"&&"["("Text")&"] into tText" do "put"&&"["("SomeOtherArrayValue")&"] into tSomeOtherArrayValue" end repeat function WrapQ pString return quote end WrapQ Ralph DiMola IT Director Evergreen Information Services