It's difficult to teach programming techniques through email. There are
lots of approaches to solving this problem, but the basic methods
involve getting a local copy of the list of files by reading the file
directory one file at a time and then applying some sorting algorithm to
the list then displaying the sorted list. A quick-and-dirty method is
to define an array of strings and fill it with the file names and then
to sort the array in some way - a bubble sort is easy to implement but
slow, quicksorts are faster. This will use a lot of memory and your
array may not be big enough to hold all of the file names in the folder
you are looking at - leading to program crashes. You could use a linked
list of files which can be expanded indefinitely in virtual memory but
is harder to sort -- the usual method of sorting a linked list is by
changing pointers to the next entry in the list. Any basic book on
algorithms would probably discuss the basics needed to do something like
this.
----- Original Message -----
From: Siva Lokanathan <[log in to unmask]>
To: Earl Truss <[log in to unmask]>
Sent: Sunday, June 25, 2000 7:11 AM
Subject: Re: Arrangement of files & folders
> > If you want the file list in alphabetic order in your program, you
> > will have to sort them yourself.
> That was very nice of you to respond so quickly to my
> inquiry. I shall be much obliged if you would kindly let me know how
to
> sort them myself in the Program?
> Thanks Siva Lokanathan
>
>
"Hold No Punches.." Rode brings you great shareware/freeware
programs with his honest opinions in this weekly column.
http://nospin.com/rode
|