Choices, Choices, Choices
Thomas McGrath III
3mcgrath at adelphia.net
Tue Feb 24 07:24:09 EST 2004
Frank,
Yes, thank you. This helps very much to see haw a real array is used. I
need to think more on it.
Are there any other benefits from the array structure?
Tom
On Feb 24, 2004, at 5:50 AM, Frank Leahy wrote:
>
> On Tuesday, February 24, 2004, at 05:52 AM,
> use-revolution-request at lists.runrev.com wrote:
>
>> I am starting a new project and have to decide the best way to store a
>> lot of info for my button states and actions.
>> right now I need to decide which is the best way to proceed???
>>
>>
>> My Decision is between arrays (which I am new to understanding),
>> Custom
>> Properties (which seem complicated for this) and Simple storage
>> containers from delimited text files (which I am used to). Any Help
>> deciding??????
> 1_title:Title 1
> ---
> 2_...
> ---
> 3_...
>
>
> At runtime I read that data into an array that has one key for each
> entry in the data file:
>
> put "[Choose A Group]" into albumData["accessGroup"]
> put "IMG_2234 foo.jpg" into albumData["coverPhoto"]
> ...
> put xxx into albumData["1_date"]
> put xxx into albumData["1_description"]
> ...
> put xxx into albumData["2_date"]
> put xxx into albumData[2_description"]
> ...
>
> I find that reading and writing the arrays is simple and plenty fast
> enough even with thousands of photos.
>
> And arrays are a great thing to use at runtime. Notice that I've
> named the keys in a way that makes it trivial to get or set any data I
> need directly. If I need the title for photo 999, then it's as easy
> as referencing albumData["999_title"]. And if I needed the titles for
> photos 100 to 199, it's as easy as:
>
> repeat with i = 100 to 199
> get albumData[i & "_title"]
> ...do something with it...
> end repeat
>
> Hope this helps.
>
> -- Frank
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Thomas J. McGrath III
SCS
1000 Killarney Dr.
Pittsburgh, PA 15234
412-885-8541
More information about the use-livecode
mailing list