No subject

Ken Ray kray at sonsothunder.com
Tue Mar 29 10:38:33 EST 2005


On 3/29/05 9: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 would be grateful for your suggestions.

That's what I like about Transcript - it is so close to how you would use
English to describe what you want! You put it perfectly: "sorted numeric by
second word of each". The only difference is you want to sort *twice*; once
by the second word to get it in numeric order, and the second time by the
first word to get it back in alphabetic order:

Here's the code:

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

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list