Sort IP List
bobsneidar at iotecdigital.com
Fri Jun 29 17:09:48 EDT 2018
Yes because your ampersand operator is not passing different arguements, it's concatenating the items together so that 10.2.245.6 produces the integer 1022456. But 10.22.2.6 produces 102226 which is smaller, but ought to sort higher. Hence the 4 pass sort.
But you got me thinking, what if you did something like:
set the numberformat to "000"
sort lines of tIPList numeric by \
value(item 1 of each +0) & \
value(item 2 of each +0) & \
value(item 3 of each +0) & \
value(item 4 of each)
> On Jun 29, 2018, at 10:29 , Mike Bonner via use-livecode <use-livecode at lists.runrev.com> wrote:
> sort lines of plist ascending numeric by item 1 of each & item 2 of each &
> item 3 of each & item 4 of each -- reverse this for your desired sort
> doesn't sort numerically (even if each key is forced to numeric with a + 0)
More information about the Use-livecode