home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
internet
/
yamtools20
/
yamtools20english
/
arexxqsort.lha
/
arexxqsort
/
QsortTest.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1990-10-01
|
788b
|
34 lines
/** QsortTest.rexx
*
* This is a test of QSORT
*
**/
arg names
if names = "" then names = "*"
/*
* FileList is a rexxarplib function.
* It returns a stem variable who's elements (files.1, files.2 ...)
* contain file names. files.0 contains the number of files found.
*/
result = FileList(names, files, , E)
say "List of files:"
do i = 1 to files.0; say files.i; end
/*
* QSORT is the QuickSort function
*
* Calling sequence:
*
* QSORT(first, last, array)
* first = number of first element to be sorted
* last = number of last element to be sorted
* array = stem variable array who's elements need to be sorted.
*
*/
call QSORT(1, files.0, files)
/*
* Print the result
*/
say ""
say "Same list, but sorted"
do i = 1 to files.0; say files.i; end