combine...doesn't?
Björnke von Gierke
bvg at mac.com
Thu Dec 9 13:52:55 EST 2010
Combine only works on one level of the array. Because of that, you need to write a repeat loop:
--untested!
repeat for each key theKey in myArray
combine myArray[theKey] by return and "/"
repeat for each line theLine in myArray[theKey]
put theKey & "/" & theLine & return after theResult
end repeat
end repeat
put theResult
On 9 Dec 2010, at 17:49, Mike Kerner wrote:
> On one-dimensional arrays, combine seems to work ok, but once I add a second
> dimension things go south.
>
> So yanking all the other data out and trying to eliminate absolutely
> everything that might do anything, I have
>
> put "x" into myArray["1"]["4"]
> put "y" into myArray["2"]["5"]
> put "z" into myArray["3"]["6"]
> combine myArray by "^" and ";"
>
> The result is 1;^2;^3;
>
>
> Can anyone explain this to me? I was TRYING to make an array of account
> nicknames, usernames, and passwords that I can write to a file, but if I
> can't get the above to work, then I certainly can't get something like
>
> ["1"]["nickname"] test
> ["1"]["username"] a
> ["1"]["password"] b
>
> to work
--
official ChatRev page:
http://bjoernke.com?target=chatrev
Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"
More information about the use-livecode
mailing list