home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / txt / zipsrt.doc < prev    next >
Text File  |  2006-10-19  |  7KB  |  197 lines

  1.            ZIPSRT.DOC (c) 1989 Wilson Van Alst, all rights reserved.
  2.  
  3.  
  4.  
  5.                                CONTENTS
  6.                                --------
  7.  
  8.           I.   Introduction:  a list of ZIPSRT features
  9.  
  10.          II.   Running from MENU:  the "ordinary" way to sort files,
  11.                sorting by column, and skipping headers
  12.  
  13.         III.   Technical Notes:  memory usage, best and worst-case files,
  14.                and what the program won't do
  15.  
  16.          IV.   Acknowledgements:  because there is a rich legacy here
  17.  
  18.  
  19.  
  20.        I. Introduction
  21.  
  22.  
  23.           A. ZIPSRT is a sorting program for .DO files in the M100/102 and
  24.              T200 computers.  It features:
  25.  
  26.              1. machine language speed
  27.  
  28.                 a. twice as fast as SORTHI.CO on large random files
  29.  
  30.              2. sorting by column
  31.  
  32.                 a. sorts data tables based on any field
  33.  
  34.              3. sorting "in place"
  35.  
  36.                 a. will handle very large files because it does not
  37.                    duplicate the file being processed
  38.  
  39.              4. sorting lines of any size
  40.  
  41.                 a. can even resequence entire paragraphs within a .DO file,
  42.                    if the paragraphs are numbered
  43.  
  44.              5. sorting from a specified line
  45.  
  46.                 a. lets you exclude "headers" from the sort
  47.  
  48.              6. easy access from BASIC
  49.  
  50.                 a. including the column sort feature
  51.  
  52.              7. operation in the AltLCD buffer
  53.  
  54.                 a. no need to CLEAR or change HIMEM
  55.  
  56.  
  57.  
  58.       II. Running ZIPSRT.CO from the MENU
  59.  
  60.  
  61.           A. Put the cursor over ZIPSRT.CO and press <ENTER>
  62.  
  63.  
  64.           B. The program will display a list of files, and ask you to name
  65.              the one for sorting
  66.  
  67.              1. you may enter the name in upper or lower-case
  68.  
  69.              2. you may include a .DO extension, but you don't have to
  70.  
  71.              3. if you respond with no file name (i.e., by hitting just the
  72.                 <ENTER> key), you'll return to the main MENU
  73.  
  74.              4. if you make a mistake and type in the name of a
  75.                 non-existent file, one of two things will happen:
  76.  
  77.                 a. if the file name was "legal," you'll return to the MENU
  78.                    and find that the file has been created -- with nothing
  79.                    in it
  80.                    1) this is not a problem for the computer, but you
  81.                       should KILL the file to get rid of clutter
  82.  
  83.                 b. if you gave an "illegal" file name (too many characters,
  84.                    for example), you'll see the BASIC "Ok" prompt
  85.                    1) you are, in fact, suddenly in BASIC -- but the
  86.                       function keys will not be working
  87.                       a) type MENU, followed by the <ENTER> key, and you'll
  88.                          return to the MENU, with no harm done
  89.  
  90.  
  91.           C. Once you give a valid answer to the file-name prompt, the
  92.              screen shows the first line of your file, with a "ruler" below
  93.              it.
  94.  
  95.              1. If your first line of text is:
  96.  
  97.                      "Last name    First name    State"
  98.  
  99.                           you will see:
  100.  
  101.                       Last name    First name      State
  102.                       ^^^^|^^^^|^^^^|^^^^|^^^^|^^^^|^^^^|^^^^|
  103.                       Col?
  104.  
  105.              2. You respond to the "Col?" prompt with a number based on the
  106.                 =screen position= of the column you wish to sort
  107.  
  108.                 a. to sort from the start of every line, you answer 1
  109.  
  110.                 b. to produce a sort based on "First name" in the above
  111.                    example, you would enter 14
  112.  
  113.                 c. to sort from the start of "State", you would enter 30
  114.  
  115.              3. You cannot enter a number that's larger than the longest
  116.                 record in your file
  117.  
  118.                 a. i.e., it makes no sense to sort on a column that doesn't
  119.                    exist
  120.                    1) if you try, you'll return to the main MENU with no
  121.                       changes made
  122.  
  123.              4. If you respond with 0, or just the <ENTER> key, the program
  124.                 will repeat the ruler display -- showing successive lines
  125.                 of text every time you hit <ENTER>
  126.  
  127.                 a. The actual sorting will begin with the last line of text
  128.                    on the screen when you specify a valid column number
  129.                    1) earlier lines in your file will not be sorted
  130.                    2) this is a useful way to cycle past "headers" in the
  131.                       file and start the sort in the actual data fields.
  132.  
  133.  
  134.           D. While it's sorting, the program will flash a cursor on the
  135.              screen to let you know something is going on.
  136.  
  137.  
  138.  
  139.      III. Technical Notes
  140.  
  141.  
  142.           A. Though ZIPSRT works on files "in place," it does need some
  143.              free memory in the computer for a buffer
  144.  
  145.              1. this overhead is established as the length of your file's
  146.                 =longest= string, plus 50 bytes.
  147.  
  148.                 a. if there's not enough room, you'll return to the MENU
  149.                    without changing anything
  150.  
  151.  
  152.           B. ZIPSRT's column sort feature  will not work on files where
  153.              columns are created with TABs instead of spaces
  154.  
  155.              1. sorts that start at Col. 1 are not affected by this
  156.                 limitation
  157.  
  158.              2. I could not fit the math for "justifying" TAB files into an
  159.                 AltLCD program
  160.  
  161.              3. BASIC programmers who want to create text files for column
  162.                 sorts should use the PRINTUSING command, because it aligns
  163.                 columns with spaces instead of TABs.
  164.  
  165.  
  166.           C. Every sorting method has a "worst case" file structure
  167.  
  168.              1. for ZIPSRT, this is when a record near the top of the file
  169.                 belongs at the end of the file
  170.  
  171.                 a. if you are adding data to a large file that's already
  172.                    sorted, put the new data at the bottom (as the BASIC
  173.                    APPEND instruction would normally do)
  174.                    1) ZIPSRT is optimized for this method of adding to a
  175.                       file.
  176.  
  177.  
  178.  
  179.       IV. Acknowledgements
  180.  
  181.  
  182.              ZIPSRT is dedicated to Rick Perry, a legendary contributor to
  183.              this forum and one of the pioneers in recognizing the M100 as
  184.              a true computer.  Several years ago, Rick wrote the machine
  185.              language sort program that has evolved into the SIG's current
  186.              'standard,' SORTHI.  Though I did not borrow from Rick's code,
  187.              he inspired the idea of a fast, small "in place" sort routine,
  188.              and ZIPSRT is built on that foundation.  Further thanks go to
  189.              Robert Covington, author of the invaluable ROM maps in Library
  190.              8, and to James Yi and Phil Wheeler, who have extended
  191.              Covington's research and documented many additional routines
  192.              in the M100/T200 ROMs.  In addition, Randy Hess offered
  193.              helpful suggestions on the way ZIPSRT should "feel" to the
  194.              user, and Randy's sense of humor was wonderful tonic for the
  195.              cold-starts and various other frustrations that go along with
  196.              machine language programming.
  197.