home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / internet / yamtools20 / yamtools20english / arexxqsort.lha / arexxqsort / QsortTest.rexx < prev    next >
OS/2 REXX Batch file  |  1990-10-01  |  788b  |  34 lines

  1. /** QsortTest.rexx
  2. *
  3. *   This is a test of QSORT
  4. *
  5. **/
  6. arg names
  7. if names = "" then names = "*"
  8. /*
  9. *   FileList is a rexxarplib function.
  10. *   It returns a stem variable who's elements (files.1, files.2 ...)
  11. *   contain file names. files.0 contains the number of files found.
  12. */
  13. result = FileList(names, files, , E)
  14. say "List of files:"
  15. do i = 1 to files.0;  say files.i; end
  16. /*
  17. *   QSORT is the QuickSort function
  18. *
  19. *   Calling sequence:
  20. *
  21. *   QSORT(first, last, array)
  22. *         first = number of first element to be sorted
  23. *         last  = number of last  element to be sorted
  24. *         array = stem variable array who's elements need to be sorted.
  25. *
  26. */
  27. call QSORT(1, files.0, files)
  28. /*
  29. *   Print the result
  30. */
  31. say ""
  32. say "Same list, but sorted"
  33. do i = 1 to files.0;  say files.i; end
  34.