> I've been playing around with the sort function for my
> property lists in order to have a sorted list that I
> can add properties to at any time in any order and
> have it sort it correctly.  The problem I'm having is
> that when you add numbers like 1, 17 and 129 it only
> sorts them up to the 2nd character so 129 comes before
> 17 in the list.  Also some of these numbers are
> followed by a letter such as 15a, 15b, 15c, etc and
> these are entered in any order as well.

Director will sort the list the way you want as long as you add numbers.
It looks like you're adding strings as properties, though, so Director
is sorting them (correctly, but not the way you want) by ASCII value.

You can't use value() when you're adding properties, because that will
return <void> for 15a, and that would really upset Howdy-tzi.

Is there any way you can use numbers for your properties? Can you use
decimals (15.1, 15.2, etc.) or charToNum() instead of letters? That
would work. In the message window:

pl=[1: "a", 2: "b", 12:"c"]
pl.sort()
put pl
-- [1: "a", 2: "b", 12: "c"]

pl.addProp(1.5, "d")
put pl
-- [1: "a", 1.5000: "d", 2: "b", 12: "c"]

Cordially,

Kerry Thompson


[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!]

Reply via email to