help with custom sort
Ron Noice
ron at ecionmicroed.com
Wed Oct 19 18:02:18 EDT 2005
Perfect. Thanks very much (and thanks to Jacque, of course) for a great=
solution.
It works exactly as advertised and the basic idea can be adapted in many=
ways.
Thanks.
... Ron
______________________________________________
*** From: Buster =A0(wouter.abraham at scarlet.be)
*** Dated: Wed, 19 Oct 2005 21:53:26 +0200
=A0Hi,
=A0This is a similar problem as in the "Silly sort question" thread
=A0Adapt Jacques' excellent solution like in:
=A0on mouseUp
=A0 =A0 ### adapt to taste
=A0 =A0 ### sortbydate(item xx of each)
=A0 =A0 ### numeric ascending or descending
=A0 =A0 sort lines of fld 1 numeric by sortbydate(each)
=A0end mouseUp
=A0function sortbydate pDate
=A0 =A0 replace word 1 of pDate with word 1 of pDate &&=A0"1," in pDate
=A0 =A0 convert pDate to seconds
=A0 =A0 return pDate
=A0end sortbydate
=A0Greetings,
=A0Wouer
=A0On 19 Oct 2005, at 20:04, Ron Noice wrote:
=A0>=A0I have a field containing several items including one for month/
=A0>=A0year pairs such as:
=A0>=A0Oct 2005
=A0>=A0Apr 2005
=A0>=A0Feb 2004
=A0>=A0Jan 2006
=A0>=A0Apr 2005
=A0>=A0Aug 2005
=A0>
=A0>=A0Is there any clever way to get these lines sorted chronologically?
=A0>=A0What I've been doing so far is generating a real date from them:
=A0>=A0Oct 1, 2005
=A0>=A0Apr 1, 2005
=A0>=A0etc.
=A0>=A0in a hidden item and sorting that.
=A0>=A0This works but I'm betting there's a way to do a custom sort
=A0>=A0thingee that works directly from the original values. But so far
=A0>=A0I've come up with nada. Any clever ideas?
=A0>
=A0>=A0... Ron
=A0>
=A0>=A0_______________________________________________
=A0>=A0use-revolution mailing list
=A0>=A0use-revolution at lists.runrev.com
=A0>=A0Please visit this url to subscribe, unsubscribe and manage your
=A0>=A0subscription preferences:
=A0>=A0http://lists.runrev.com/mailman/listinfo/use-revolution
=A0>
=A0_______________________________________________
=A0use-revolution mailing list
=A0use-revolution at lists.runrev.com
=A0Please visit this url to subscribe, unsubscribe and manage your=
subscription preferences:
=A0http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list