>
> ["1", "10", "2", "3", "4", "5"]  is correct.
> [1, 2, 3,4,5,10] is correct.
>
> Hmmm...now I gotta figure out a way of dealing nicely with this.

Here's one way.  (untested Lingo)

Regards,

Daniel

--both of these appear in the same parent script

on getSortedFileList me, fileList
--fileList is a list of the form [aString1.ext, aString10.ext, aString2.ext, ..., 
aStringijk.ext]
--returns a sorted, property list version of fileList
sortedFileList = [:]
sortedFileList.sort()

the itemDelimiter = "."

repeat with fileNameString in fileList
    aString = fileNameString
    if aString.items.count > 1 then delete the last item of aString --delete the file 
extension
--if one exists
    numberString = EMPTY
    repeat while me.isNumber(the last char of aString)
           put the last char of aString before numberString
           delete the last char of aString
    end repeat
    sortedFileList.addProp(integer(numberString, fileNameString)
end repeat

return sortedFileList
end getSortedFileList




on isNumber me, aChar
  --copyright � 2003 Daniel W. Nelson
  --aChar may be an integer. if so, it is considered the ASCII
  --value of a character.
  if integerP(aChar) then charNum = aChar
  else charNum = charToNum(aChar)
  return charNum >= 48 and charNum <= 57
end isNumber



[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to