PDA

View Full Version : Resolved Sort?



Nile
12-24-2008, 03:07 PM
This Thread refers back to: http://www.dynamicdrive.com/forums/showthread.php?t=40007

John this is probably a stupid question:
What about the .jpg? It can't sort that? Does that get removed earlier in the script?

jscheuer1
12-24-2008, 03:20 PM
John this is probably a stupid question:
What about the .jpg? It can't sort that? Does that get removed earlier in the script?

Sorting starts from the beginning of each string, as soon as the alphanumeric order of each string is determined, the rest of the string is ignored, regardless of how long it is. So:

0z.jpg

would come before:

1abcdefg.jpg

But this points up how consistency in the file naming convention must be applied. Dates and months that can be expressed as singe digits must be padded with a preceding 0, as I did in my example, using 01 for January, etc. So, as another example, May 8th, 2007 should be named:

20070508.jpg