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 Pete lcSQL Software <http://www.lcsql.com> _______________________________________________ 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