order of array is different after split

Mark Schonewille m.schonewille at economy-x-talk.com
Tue May 21 06:00:24 EDT 2013


Hi Tiemo,

Since you're just asking for comments, I'm not sure what kind of answer 
you're looking for but I'll try.

To process an array in sorted order, you can put the keys into a variable:

put the keys of myArray into myKeys
sort the lines of myKeys ascending international
repeat for each line myKey in myKeys
   // do something with myArray[myKey]
end repeat

This processes the array in internationally sorted order.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

On 5/21/2013 11:46, Tiemo Hollmann TB wrote:
> Hi,
>
> when splitting a plain list into an array, the order of the array is
> different to the source list. E.g. if the list was sorted international, the
> array is sorted standard. Is this a standard behavior of split, or do I have
> any options on the array order.
>
> I know, as far as you access the array by its keys, the order isn't
> relevant, but sometimes it might by suitable to process the array in
> sequence and then it could be valuable if the sequence is the same as the
> origin.
>
>
>
> Any comments?
>
> Tiemo
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>




More information about the Use-livecode mailing list