As Craig said, your rules are not consistent to standards:
You sort *after* the first period numeric with the exception
that leading zeros are "valid".
That's why the replace in the following function is needed.
This now yields exactly your custom sort order:
function gregSort s
set itemdel to "."
sort s numeric by offset("a",each)
sort s numeric by offset("b",each)
sort s numeric by offset("c",each)
replace ".0" with ".0." in s --> begin make leading zeros valid
sort s numeric by item 2 to 3 of each
replace ".0." with ".0" in s --> end make leading zeros valid
sort s numeric by item 1 of each
return s
end gregSort
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode