home *** CD-ROM | disk | FTP | other *** search
-
- DocSorter v1.0 - M. Joel Guerra
-
- This simple deck demonstrates the use of CanDo's SortDocument
- command. You can sort text files starting at any column from 1
- to 80, in ascending or descending order, case-sensitive or not
- case-sensitive. Use the Find File button to find the file to
- sort, or enter its name in the Source File: field.
-
- You can change the Destination entry to direct output to the
- PRT: device or any other valid output device (for example,
- "CON:0/0/640/100/MySortedFile", if you really want to do
- something interesting and useless). A good destination would be
- something like "RAM:Temp" if the file to sort is small enough.
-
- Enter a starting column (if different than 1) by clicking on
- the number and editing it. Clicking on Ascending will change it
- to Descending and vice versa. The same applies to the Yes/No for
- Case Sensitivity.
-
- When ready to sort, just select the Sort File button or the
- appropriate menu item or even the short-cut key, Right-Amiga-S.
- The status field will keep you informed as to the progress of the
- sort.
-
- To quit, select the Close button (gadget) in the upper left
- of the window, or the Quit menu item, or press Right-Amiga-Q.
-
- ============== For those with CanDo ==================
-
- For those of you who have CanDo, this deck also demonstrates
- the DoOnError command. When encountered in a script, this
- command tells CanDo (or cando.library) that error handling will
- be done by the routine referenced by the DoOnError. This is a
- very useful command, for it can prevent your application from
- exiting mysteriously back to Workbench without telling the user
- that an error occurred.
-
- You will also find another example of the AskForFileName
- function, and see a couple of ways to handle what it returns. If
- you are using CanDo v1.0 or v1.01 in browse mode, you will be
- told that SetAutoFileRequester is a privileged command. Just
- select OK to ignore the error. SetAutoFileRequester is no longer
- privileged as of CanDo version 1.02. Actually, the only reason
- SetAutoFileRequester is even used is to get around the FileType
- bug that causes the file requester to pop up (saying "Wrong File
- Type") when only a directory is specified. (This, too, is fixed
- as of v1.02.)
-
- Feel free to adapt any of the routines to your own purposes,
- but don't use the program as an example of good programming.
- It's a hack, and there are a few sections of code which could be
- optimized.
-
- -- Joel
-