Bizarre Number Sort of Files Mac

Brian Milby brian at milby7.com
Sun Mar 11 00:14:23 EST 2018


That strange dictionary entry was due to a bug in the parser. It is fixed
now (9DP11 does not have that bug, not sure about 8).

Now, not sure about the actual sort issue...
On Sat, Mar 10, 2018 at 10:27 PM Sannyasin Brahmanathaswami via
use-livecode <use-livecode at lists.runrev.com> wrote:

> Well the dictionary has this cryptic entry
>
> "If you don't specify a sortType, the sortType is text.
>     numbers)"
>
> ??
>
> I thought, wrongly so, sort alpha text, ascending, was the default
>
> sort line fld "imageIist"  # would get you want
>
> But the solution was simple
>
> sort lines fld "imageList" ascending text  # this gets want I need
>
> So, the default is mysterious; but, explicitly call, will work.
>
> BR
>
>
>
> Bob Sneidar wrote:
>
>     Hmmm... I ran into this a few days ago. If you sort numeric, and any
> of the values are not numeric, the sort fails silently. I would have
> expected it to sort with the affinity for numeric, but that apparently is
> not how the sort command works. If you were to simply sort without the
> numeric arguement, it would work, since your filenames are already padded
> with zeros. If this needs to work with *any* file list, I think you may be
> in trouble.
>
>     One option would be to iterate in a repeat loop through each line,
> then iterate through each character, adding the current character to a
> value then checking if the value is a number. When it's not, put char 1 to
> -2 of the value into item 1 of a new list, the actual filename into item 2
> of the new list, sort lines of <list> numeric ascending by item 1 of each,
> then iterate through the lies again, putting item 2 of each line in a new
> list.
>
>     You could create a function that does this.
>
>     Bob S
>
>
>     >On Mar 9, 2018, at 10:46 , PEL via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>     >When you add text to a number, it ceases to be a number.
>     >If you had a space between 01-11-04-09-_2018 and the rest of the line
> you might be able to
>     >sort lines of field “TheFiles” dateTime ascending by word one of each
>     >Paul Looney
>
>
>
> _______________________________________________
> 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