Intelligent sorting: A bit of a poser

Colin Holgate coiin at verizon.net
Thu Jul 1 10:25:45 EDT 2010


On Jul 1, 2010, at 10:16 AM, DunbarX at aol.com wrote:

> Hold everything. Doesn't work.

I noticed. This does though:

on mouseUp
      put separateNumbers(fld yourField) into temp
      sort temp numeric   by item 2 of each & item 1 of each
      sort temp by item 1 of each
      replace comma with empty in temp
      put temp into fld yourField
end mouseUp

function separateNumbers var
   repeat with a = 1 to the number of lines in var
      repeat with b = 1 to the number of chars in line a of var
          if char b of line a of var is in "0123456789" then
            put comma before char b of line a of var
            exit repeat
         end if
        end repeat
   end repeat
      return var
end separateNumbers





More information about the use-livecode mailing list