a = [1:"a",10:"b",2:"c"]
a.sort()
put a
-- [1: "a", 2: "c", 10: "b"]
Is that what you wanted?
Hey, and what happened to item 10?
On 6-jul-2006, at 14:22, julian weaver wrote:
hi,
Does anyone know of a decent algorithm for sorting director lists
numerically?
e.g. for a directory alphabetically sorted with no leading zeros.
a 1
a 10
a 100
a 11
a 12
a 2
a 21
would become
a 1
a 2
a 11
a 12
a 21
a 100
I can't believe I've never come up against this before :/
Julian
[To remove yourself from this list, or to change to digest mode, go
to http://www.penworks.com/lingo-l.cgi To post messages to the
list, email [email protected] (Problems, email owner-
[email protected]). Lingo-L is for learning and helping with
programming Lingo. Thanks!]
Mark Hagers
[EMAIL PROTECTED]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]