Now that is weird because the sort is definitely working for me.    OH
wait, you don't set the numberformat in your function.  Do you set it
elsewhere, and if so, does it stick when the function is called?  The sort
is definitely, no question, working for me.

I generate a list of IPs then in the msg box do this..

set the numberformat to "000"
set the itemdel to "."
put the millisec into tstart
sort lines of tList ascending numeric by (item 1 of each +0) & (item 2 of
each + 0) & (item 3 of each + 0) & (item 4 of each + 0)
put the millisec - tstart
put cr & tList after msg -- the list is sorted.

Not sure why it isn't working for you, but on the off chance its a version
difference, i'm on 9.0, community +, stable.

On Fri, Jun 29, 2018 at 4:33 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I have good news and bad news!
>
> function sortIPList2 pIPList
>    set the itemdelimiter to "."
>    try
>       sort lines of pIPList ascending numeric \
>             by (item 1 of each + 0) & \
>             (item 2 of each + 0) & \
>             (item 3 of each + 0) & \
>             (item 4 of each + 0)
>    catch theError
>       breakpoint
>    end try
>    return pIPList
> end sortIPList2
>
> With a small subset of data, it doesn't error meaning I have some cruft in
> the data. Fair enough. The bad news is... IT DOESN'T SORT! LOL!!! Reversing
> the items does not help either.
>
> Bob S
>
> > On Jun 29, 2018, at 15:16 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Yup, that would be it!
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to