help with custom sort
ron at ecionmicroed.com
Thu Oct 20 07:46:09 CDT 2005
Thanks. I've adopted/adapted the previous idea and it worked well so I'm going to stick with it. But will keep your suggestion for future reference -- never can tell when these things will come in handy! Thanks.
*** From: FlexibleLearning at aol.com (FlexibleLearning at aol.com)
*** Dated: Thu, 20 Oct 2005 02:07:08 EDT
I found this synchronized list sorting handler in the Scripter's Scrapbook.
It may need a bit of tweaking for rev, but may give you some ideas...
local lKeyData, lLineCounter
on sortBy keyField -- parallel sorting of linked flds
put fld keyField into lKeyData
put "data1,data2,data3" into dataFields -- fill in your fld names here
repeat with i = 1 to the number of items of dataFields
put 0 into lLineCounter -- must be reset prior to each sort
sort lines of fld (item i of dataFields) by key()
add 1 to lLineCounter
return line lLineCounter of lKeyData
Based on an old HyperCard script by Brett Sher.
I have a field containing several items including one for month/year pairs
Is there any clever way to get these lines sorted chronologically? What I've
been doing so far is generating a real date from them:
Oct 1, 2005
Apr 1, 2005
in a hidden item and sorting that.
This works but I'm betting there's a way to do a custom sort thingee that
works directly from the original values. But so far I've come up with nada. Any
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode