Dear All,
Thanks for your responses. As usual I ended up having to do something
else last week so didn't a chance to write a lingo version.
I ended up using a javascript version of Martin Pool's Natural Order
string Comparison (http://sourcefrog.ozlabs.org/projects/natsort/)
from http://sourcefrog.ozlabs.org/projects/natsort/natcompare.js
My test array: ["x2-y08", "10-20", "1-20", "pic02000", "fred", "jane",
"1-02", "pic01", "x2-y7", "pic4", "pic02", "pic3", "volume 01",
"pic120", "pic 4", "pic2", "x8-y8", "pic 5", "pic 005 ", "pic02a",
"pic100a", "pic 6", "pic 7", "pic100", "pic 5 something", "pic 05",
"pic121", "tom", "x2-g8", "volume 1", "some filename", "another
filename", "1-2"]
If anyone's interested, I've put an mx2004 file up at
http://dev.ouhypo.org/nat_sort.zip.
It's a crude implementation but it might be useful for someone as a
starting point.
when I get a bit of time, I'll rewrite the main function using a better
sort algorithm and repost.
Julian
[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!]