sorting advice

Mark Smith lists at futilism.com
Fri Jun 19 05:02:12 EDT 2009


Nicolas, this might a good case for using a custom sort like:

on mouseUp
    put fld 1 into tData
    sort lines of tData dateTime by toDate(word 2 of each)
    put tData
end mouseUp

function toDate pStr
    replace "." with "/" in pStr
    return pStr
end toDate

Best,

Mark Smith

On 19 Jun 2009, at 06:23, Nicolas Cueto wrote:

> Still avoiding thinking too much...
>
> Given this list (a ref-number followed
> by a dot-separated date):
>
>  bg2334 12.21.09
>  bg9788 1.10.02
>  bg6554 11.30.11
>  bg8902 6.6.04
>  bg4021 2.29.12
>  bg1210 1.2.02
>  bg3008 12.3.09
>  bg5526 5.29.04
>
> what sort-command combo would
> re-order it ascending by the date
> to become:
>
>   bg1210 1.2.02
>   bg9788 1.10.02
>   bg5526 5.29.04
>   bg8902 6.6.04
>   bg3008 12.3.09
>   bg2334 12.21.09
>   bg6554 11.30.11
>   bg4021 2.29.12
>
>
> Note that the ref-number and the date
> are space-separated, and I'm using
> "." instead of the english date's "/".
> Also, the date form is "month[1-12,
> no leading zero], day[1-31], year [00-
> 09, leading zero].
>
> I'll be experimenting on my own to hit on
> the magic combination, but in the meantime
> I thought I'd post a plea since someone is
> very likely to reply a solution sooner than I
> can guess one up.
>
> Thank you.
>
> --
> Nicolas Cueto
> _______________________________________________
> 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