sorting - THANK YOU Colin!!

larry at significantplanet.org larry at significantplanet.org
Sat Aug 9 12:56:10 EDT 2014


Hi Colin
Thanks for clarifying!
Larry

----- Original Message ----- 
From: "Colin Holgate" <coiin at verizon.net>
To: "How to use LiveCode" <use-livecode at lists.runrev.com>
Sent: Saturday, August 09, 2014 10:51 AM
Subject: Re: sorting - THANK YOU PAUL!!


I tried Craig’s approach, but with the correct syntax, not the condensed 
example he gave. I put your example list into field 1, and had this script 
in a button:

on mouseUp
   put fld 1 into fld 2
   sort fld 2 by word 1 of each & word 2 of each
end mouseUp

I then scrambled (manually) the lines of field 1. That consistently gives 
back the list in the sorted order you showed.

Next I tried this script:

on mouseUp
   repeat with a = 1 to 100
      put item random(2) of "advanced,beginner" && random(100) into line a 
of fld 1
   end repeat
   put fld 1 into fld 2
   sort fld 2 by word 1 of each & word 2 of each
end mouseUp

Field 1 had a random list of advanced and beginner entries, with a level 
too, and after clicking the button field 2 showed the list as sorted.

Now, it’s an alpha sort not a numeric sort, and Paul’s approach, which was 
the same as Björnke’s, also fails in that way.

So, Craig’s suggestion was good, just not with the syntax expanded.
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode 





More information about the use-livecode mailing list