This topic is locked
[SOLVED]

 Sorting files in a directory

7/5/2011 5:04:15 PM
ASPRunnerPro General questions
J
jawendell author

In my application I have instances where if a user clicks on a specific link, the files of a directory will be displayed as a list of links to those files. Currently, the list is being sorted by the date of the file. Is there a basic way to sort the file names alphabetically?
Any suggestions would be greatly appreciated.
Thanks.

Sergey Kornilov admin 7/11/2011

Jerome,
how do you get the list of files? Is that something that web server provides to you or you use your own script?

J
jawendell author 7/11/2011



Jerome,
how do you get the list of files? Is that something that web server provides to you or you use your own script?


Sergey,
Thanks for your reply.
The list of files is obtained in an ASP script.
Jerome

Sergey Kornilov admin 7/11/2011

I guess you need to make changes to this ASP script in order to present files in alphabetic order. It all depends on what kind of script you use for this purpose.

J
jawendell author 7/11/2011



I guess you need to make changes to this ASP script in order to present files in alphabetic order. It all depends on what kind of script you use for this purpose.


Sergey,
I have done some reading that seems to indicate the sorting can be done using VBScript or JScript. Which method do you think is the most efficient?
Thanks,
Jerome

Sergey Kornilov admin 7/12/2011

It depends on how your script stores data. For example, if you store data in array, you can use function QuickSort described at http://evolt.org/node/21724

J
jawendell author 7/12/2011



It depends on how your script stores data. For example, if you store data in array, you can use function QuickSort described at http://evolt.org/node/21724


Sergey,
Thanks for the input. I will check it out.
Jerome