text sortType

Peter Haworth pete at lcsql.com
Tue May 28 15:41:48 EDT 2013

The following worked for me (with apologies ofr any asterisks that may be
inserted into the script by my email client)

It assumes there won;t be any numbers > 6 digits.

*on* mouseUp

   *sort* lines of field "Field" by reformatLine(each)

*end* mouseUp

*function* reformatLine l

   *local* tKey

   *put* word 1 to -2 of item 1 of l into tKey

   *repeat* 6-the length of word -1 of item 1 of l

      *put* zero after tKey

   *end* *repeat*

   *put* word -1 of item 1 of l after tKey

   *return* tKey

*end* reformatLine

lcSQL Software <http://www.lcsql.com>

More information about the Use-livecode mailing list