Graham Samuel wrote:

> If you do a numeric sort by these numbers, 1000 will come before 9.

If a numeric sort produces that outcome either the data isn't purely numeric or you've found a bug.


> Without this, an XML file with child nodes in a certain order will
> end up in a different order when converted to an array - and an order
> that isn't that easy to modify at this point.

LiveCode's arrays are associative arrays, in which elements have no inherent order relative to one another.

Keys are associated with values by a hash that determines the memory location of the value, and like most hashes the result maintains no metadata which describes either insertion order or order relative to other key values.

We can access array elements with a sense of order by first obtaining the keys and sorting those in whatever way is needed for the task at hand (numeric, alphanumeric, dateTime, etc.; provided of course the sort command works as questioned above).

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to