IndexedFile Question
amorfa
1) How does the index in the folder work? ie if I have 5 files, will index 0 be the first file name in alphabetical order or perhaps when the first file was created? It is hard to tell, but after a few trial and error attempts, it feels like it is alphabetical order, I would just like to be sure.
Thanks for any input!
Cheers,
Anthony
indexedfile
is useful for enumerating the files of a certain type in a directory. You can then usesortlist
to sort the list of files into any which way you want, in terms of name. It's not a good idea to rely on the order of indexedfile, as it doesn't specify an order in the help manual.e.g.
string sortedfiles = sortlist(files, ";", 16) //an alphanumeric sort, w0->w9->w10 instead of w0->w10->w9
print sortedfiles
July 27, 2009 at 11:21 pm - Permalink
July 28, 2009 at 04:38 am - Permalink
July 28, 2009 at 05:25 am - Permalink
Cheers
July 28, 2009 at 05:40 am - Permalink
That API may or may not return them sorted.
Sorting takes time, and isn't always wanted. Speed *is* generally desireable, so we don't sort the returned result. That's what SortList is for :-)
Software Engineer, WaveMetrics, Inc.
July 28, 2009 at 11:19 am - Permalink