sorting words ?

jbv at souslelogo.com jbv at souslelogo.com
Wed Dec 9 11:28:35 EST 2015


Well, I don't want to keep this thread going forever but still...
I do understand Mark's explanations, but still I don't understand
this :

since this is allowed (and returns the expected result) :
   get "the      quick brown  fox    jumped over     the lazy         dog"
   set itemdel to space
   sort items of it ascending

why not have the engine temporarily replacing the current itemdel
with space, do the sorting of words, and then setting itemdel back to its
previous value... Of course this would be transparent to the coder...
Some will say "what's the use ? Simply set the itemdel to space"...
But this would allow words sorting, as well as sorting in more
complex data structures, such as words inside items inside lines...

jbv


> On 2015-12-09 13:42, jbv at souslelogo.com wrote:
>> Hi Mark,
>>
>> I am probably missing something, but items can be separated by multiple
>> itemdelimiters too, but nevertheless the sorting function works, as in
>> this
>> example :
>>    get "12,5,,4,10,,,11,24"
>>    sort items of it ascending numeric
>>
>> it returns ,,,4,5,10,11,12,24
>> and no compilation error...
>
> Right - but:
>
> "1,2,,,,3,4,5"
>
> Is a list of 8 items - 3 of them empty.
>
> "the    quick   brown fox  jumped"
>
> Is a list of 5 words - multiple item delimiters mean something, multiple
> spaces are just a single 'delimiter' in this context.
>
> Warmest Regards,
>
> Mark.
>
>
> --
> Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> 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
>





More information about the use-livecode mailing list