A 'sorted list' is something different from a non-sorted list that
has its items added in alphabetical order.
Citing the Online help:
"After a list is sorted, it maintains its sort order even when you
add new variables using the add command."
This can be a most useful feature... One obvious example is when you
read in file names from a folder on the disk, and want them to be
sorted in name order.
The very first thing you do is to sort the list before starting to
add file names to it, then you don't have to think about it no more!
(The OS reports files in slot order.)
(Beware though, if you are working with very big lists, that it takes
longer time to add items to a sorted list.)
-Andreas
>Yep, figured it out. But I don't understand why one has to sort it when it's
>already sorted... Is there a 'sorted' flag somewhere in the member internals?
>
>Roy Pardi wrote:
>>
>> At 12:52 PM -0600 9/2/2000, Brad Waite wrote:
>> >Hi all,
>> >
>> >findPosNear isn't working the way I read the dictionary. What could
>> >I be doing
>> >wrong?
>> >
>> >fred = ["apple", "bat", "car"]
>> >put findPosNear(fred, "b")
>> >-- 0
>>
>> You need to sort it first:
>>
>> fred = ["apple", "bat", "car"]
>> sort(fred)
>>
>> put findPosNear(fred, "b")
>> -- 2
>> --
>>
>> Roy Pardi
>>
>> [To remove yourself from this list, or to change to digest mode, go to
>> http://www.penworks.com/LUJ/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!]
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/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!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]