No subject
Howard Bornstein
howard.bornstein at gmail.com
Fri Apr 1 16:38:15 EST 2005
On Apr 1, 2005 4:22 PM, Ken Ray <kray at sonsothunder.com> wrote:
> On 4/1/05 11:42 AM, "Howard Bornstein" <howard.bornstein at gmail.com>
> wrote:
>
> > On Mar 29, 2005 10:15 AM, Melitón Cardona Torres <toncardona at mac.com>
> > wrote:
> >> I have this in a field:
> >>
> >> IPAE 16
> >> IPAE 1
> >> IPAE 7
> >> LAG 1
> >> JKAL 3
> >> JKAL 11
> >> JKAL 2
> >>
> >> and I wish to get this (same alphabetical order, sorted numeric by
> >> second word of each):
> >>
> >> IPAE 1
> >> IPAE 7
> >> IPAE 16
> >> LAG 1
> >> JKAL 2
> >> JKAL 3
> >> JKAL 11
> >>
>
> I still think it's easier to let Rev handle the sorts:
>
> put fld 1 into tData
> sort tData numeric by word 2 of each
> sort tData by word 1 of each
> put tData into fld 2
>
> Just my 2 cents,
>
Ken,
I would have used the same code as yours, however, it doesn't preserve
the original alphabetic order (which I assumed he wanted--if not then
your code is perfect).
My code (and Frank's) ends up with the list sorted like this:
IPAE 1
IPAE 7
IPAE 16
LAG 1
JKAL 2
JKAL 3
JKAL 11
Yours puts LAG 1 at the end, since it sorts the entire list
aphabetically. So if he wants to keep the original alpha order intact
and just sort within the alpha groups, you need to add a little more
control to the sorts. Otherwise the simple solution is fine.
--
Regards,
Howard Bornstein
-----------------------
www.designeq.com
More information about the use-livecode
mailing list