text sortType

J. Landman Gay jacque at hyperactivesw.com
Tue May 28 14:58:25 EDT 2013


On 5/28/13 1:46 PM, Andrew Kluthe wrote:
> Ah, I should have been more clear in my example.
>
> Item 1 is a string consisting of a name and a number with a space in
> between. The other items I have not provided examples of here, because they
> contain information unrelated to the sort  but may have made what I am
> trying to do more clear.
>
> If i sort by item 1 I would assume that "MO 8" would be placed before "MO
> 12" but it stops when it comes to the number.
>
> I beleive this is because the "1" in "12" in the example above comes before
> "8". I wish it would consider "12" an entire number in the match, but I
> understand why it doesn't work this way because it is using ASCII numbers
> to sort them yes?
>
> I always get in the habit of setting the itemDelimiter right before a sort,
> so i don't think it's getting changed.

Does this do it?:

sort lines of fld 1 numeric by word 2 of each
sort lines of fld 1 by word 1 of each


> On Tue, May 28, 2013 at 1:22 PM, <dunbarx at aol.com> wrote:
>
>> There is an undocumented feature, though it is noted in the user notes
>> under "sort" and "sort container" in the dictionary:
>>
>>
>> sort by sortKey1 & sortKey2 & sortKey3...
>>
>>
>>
>> all in one line. Both methods produce stable multiple sorts.
>>
>>
>>
>> Craig Newman
>>
>>
>>
>>
>> -----Original Message-----
>> From: Tiemo Hollmann TB <toolbook at kestner.de>
>> To: 'How to use LiveCode' <use-livecode at lists.runrev.com>
>> Sent: Tue, May 28, 2013 1:35 pm
>> Subject: AW: text sortType
>>
>>
>> How about sorting twice
>> sort lines of sReportText numeric by item 2 of each
>> sort lines of sReportText by item 1 of each
>> didn't tested
>> Tiemo
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] Im
>> Auftrag
>>> von Andrew Kluthe
>>> Gesendet: Dienstag, 28. Mai 2013 19:06
>>> An: How to use LiveCode
>>> Betreff: text sortType
>>>
>>> Hello Ya'll,
>>>
>>> I am trying to sort some tab delimited data by item 1 of each. Item 1 of
>>> each is a name and a number.
>>>
>>> Kansas 1
>>> Kansas 3
>>> MO 3
>>> MO 8
>>>
>>>
>>> Anyhow, when I run the sort as
>>>
>>> sort lines of sReportText by item 1 of each
>>>
>>> I get it sorted pretty close, but entries with the same name and a
>>> different number are not sorted numerically after being sorted
>>> alphabetically.
>>>
>>> Are there any built in options or tricks I could use to get the desired
>>> result without having to write a custom sort function for this seemingly
>>> simple task?
>>>
>>>
>>>
>>> --
>>> Regards,
>>>
>>> Andrew Kluthe
>>> andrew at ctech.me
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the Use-livecode mailing list