Arrays: new and old keys, i
David Bovill
david at vaudevillecourt.tv
Sun Sep 14 19:53:04 EDT 2008
Mark - looking at your script this is NOT doing what we need. It is not
sorting the keys - it is simply sorting a list, which happens to be inside
of an array. By that I mean nothing is actually happening to the array - you
simply extract the contents of an array and sort it.
2008/9/14 Mark Brownell <gizmotron at earthlink.net>
>
> on mouseUp
> put "" into field "results"
> put "hatTrick,rabbit drops,fish food,catfish bait," into
> myArray[9]["sortKeys"]
> put "fish stories" & "," after myArray[9]["sortKeys"]
> put myArray[9]["sortKeys"] & return & return into field "results"
> sort items of myArray[9]["sortKeys"] by word 1 of each
> put myArray[9]["sortKeys"] after field "results"
> end mouseUp
So this is the same as:
put myArray[9]["sortKeys"] into plainOldList
sort items of plainOldList by word 1 of each
We still cant use things like:
on mouseUp
put "" into field "results"
put "hatTrick,rabbit drops,fish food,catfish bait" into someList
repeat for each item someItem in someList
put random(10) into testArray [someItem]
end repeat
-- does not compile
sort keys of testArray by word 1 of each
put keys(testArray) after field "results"
end mouseUp
And even if we could, that doesn't simplify the job of registering the
sequential order FIFO stye - which we still have to do manually, with all
the speed loss associated with extra lines of code and using slower repeat
structures.
Ask the others what is proposed.
> It's mainly what they want. Read their past posts and sort that out.
I will - I'll put them into an array.
I have exactly what I want now
I don't :)
Though you have taught me some cool syntax!
More information about the use-livecode
mailing list