Arrays: new and old keys
Mark Brownell
gizmotron at earthlink.net
Sat Sep 13 01:14:39 EDT 2008
sorry, I'm on digest mode.
>> put myArray["#476532"][4][3] into shippingPriceWestCoast
>
>I would assume you'd also be able to do:
>
> put myArray["#476532"]["shipping"]["west"] into shippingPriceWestCoast
>
>Right?
>
>Ken Ray
Ken,
Yes, right, you could.
I'm mentioning it because you can use variables that are numeric to help you.
repeat with i = 1 to 1000
if myArray["#476532"]["shipping"][i] = "Galveston,Tx" then
put myArray["#476532"]["shipping"][i]["price"] into shippingPrice
exit repeat
end if
end repeat
So knowing what your data structure is oriented like you can write simpler code:
put myArray["#476532"][4][i][1] into shippingPrice
More information about the use-livecode
mailing list