RE: getting files in a directory sequentially.
- Posted by Lewis Townsend <Keroltarr at hotmail.com> Jan 12, 2004
- 412 views
Howdy sixs, I've noticed that before too. If you want them sorted by file name you can sort() your dir() results. --Tested code: include get.e include file.e object d d = dir( current_dir() ) for f = 1 to length( d ) do puts( 1, d[f][D_NAME] & '\n' ) end for puts( 1, "\n <press any key to sort the file list>\n\n" ) if wait_key() then end if d = sort( d ) for f = 1 to length( d ) do puts( 1, d[f][D_NAME] & '\n' ) end for puts( 1, "\n <press any key to exit>\n\n" ) if wait_key() then end if -- end code Now, if you want it sorted by any other value such as size, type, etc. it will be a little more complicated. later, LewyT