home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / CanDo / Decks3 / DocSorter / DocSorter.doc next >
Encoding:
Text File  |  1990-01-25  |  2.4 KB  |  56 lines

  1.  
  2.           DocSorter v1.0 - M. Joel Guerra
  3.  
  4.     This simple deck demonstrates the use of CanDo's SortDocument
  5. command.  You can sort text files starting at any column from 1
  6. to 80, in ascending or descending order, case-sensitive or not
  7. case-sensitive.  Use the Find File button to find the file to
  8. sort, or enter its name in the Source File: field.
  9.  
  10.     You can change the Destination entry to direct output to the
  11. PRT:  device or any other valid output device (for example,
  12. "CON:0/0/640/100/MySortedFile", if you really want to do
  13. something interesting and useless).  A good destination would be
  14. something like "RAM:Temp" if the file to sort is small enough.
  15.  
  16.     Enter a starting column (if different than 1) by clicking on
  17. the number and editing it.  Clicking on Ascending will change it
  18. to Descending and vice versa.  The same applies to the Yes/No for
  19. Case Sensitivity.
  20.  
  21.     When ready to sort, just select the Sort File button or the
  22. appropriate menu item or even the short-cut key, Right-Amiga-S.
  23. The status field will keep you informed as to the progress of the
  24. sort.
  25.  
  26.     To quit, select the Close button (gadget) in the upper left
  27. of the window, or the Quit menu item, or press Right-Amiga-Q.
  28.  
  29.      ============== For those with CanDo ==================
  30.  
  31.     For those of you who have CanDo, this deck also demonstrates
  32. the DoOnError command.  When encountered in a script, this
  33. command tells CanDo (or cando.library) that error handling will
  34. be done by the routine referenced by the DoOnError.  This is a
  35. very useful command, for it can prevent your application from
  36. exiting mysteriously back to Workbench without telling the user
  37. that an error occurred.
  38.  
  39.     You will also find another example of the AskForFileName
  40. function, and see a couple of ways to handle what it returns.  If
  41. you are using CanDo v1.0 or v1.01 in browse mode, you will be
  42. told that SetAutoFileRequester is a privileged command.  Just
  43. select OK to ignore the error.  SetAutoFileRequester is no longer
  44. privileged as of CanDo version 1.02.  Actually, the only reason
  45. SetAutoFileRequester is even used is to get around the FileType
  46. bug that causes the file requester to pop up (saying "Wrong File
  47. Type") when only a directory is specified.  (This, too, is fixed
  48. as of v1.02.)
  49.  
  50.     Feel free to adapt any of the routines to your own purposes,
  51. but don't use the program as an example of good programming.
  52. It's a hack, and there are a few sections of code which could be
  53. optimized.
  54.  
  55.     -- Joel
  56.