help with custom sort

Buster wouter.abraham at scarlet.be
Wed Oct 19 15:53:26 EDT 2005


Hi,

This is a similar problem as in the "Silly sort question" thread
Adapt Jacques' excellent solution like in:

on mouseUp
   ### adapt to taste
   ### sortbydate(item xx of each)
   ### numeric ascending or descending
   sort lines of fld 1 numeric by sortbydate(each)
end mouseUp

function sortbydate pDate
   replace word 1 of pDate with word 1 of pDate && "1," in pDate
   convert pDate to seconds
   return pDate
end sortbydate

Greetings,
Wouer

On 19 Oct 2005, at 20:04, Ron Noice wrote:

> I have a field containing several items including one for month/ 
> year pairs such as:
> Oct 2005
> Apr 2005
> Feb 2004
> Jan 2006
> Apr 2005
> Aug 2005
>
> 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
> etc.
> 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 clever ideas?
>
> ... Ron
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>




More information about the use-livecode mailing list