home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / tools / squish / squish.doc next >
Text File  |  1983-02-09  |  6KB  |  113 lines

  1.                 SS SS SS SS SS SS SS SS SS SS SS
  2.                 SS                            SS
  3.                 SS        IBM PC Basic        SS
  4.                 SS          "Squish"          SS
  5.                 SS   Author: Dave Archibald   SS
  6.                 SS Translation: Alan J. Zett  SS
  7.                 SS    Copyright (c) 1982      SS
  8.                 SS SoftSide Publications, Inc SS
  9.                 SS                            SS
  10.                 SS SS SS SS SS SS SS SS SS SS SS
  11. "Squish" is a utility program for the IBM PC with 32K,
  12. color/graphics adapter, 1 disk drive, and Basic.
  13.  
  14. (The following is condensed from SoftSide magazine, issue no. 34.)
  15.  
  16.      Programmers tend to use quite a few REMarks when
  17. programming, add extra spaces to make listings more readable, as
  18. well as putting only a few statements on each line.  The result
  19. is a program that is easier to read and debug, but not very space
  20. or memory efficient.  The ideal utility would remove extra spaces
  21. and REMs, and combine lines, when possible without altering the
  22. structure of the BASIC program.
  23.      Enter the TRS-80 program Squish...if only it were translated
  24. to the IBM PC.  We've done so, and it is presented here for the
  25. benefit of all our IBM subscribers.
  26.  
  27. TO USE SQUISH:
  28.      First LOAD the program you wish to pack.  After it is
  29. loaded, SAVE it with the ASCII option to a new file.  For example:
  30. LOAD "MYPROG.BAS" and then reSAVE it as "MYPROG.ASC",A.  After
  31. the program has been saved with the ASCII option, LOAD in
  32. "Squish" and type RUN.
  33.      Answer the first question with the name of the file saved
  34. with the ASCII option ("MYPROG.ASC" in the example above).
  35.      You will then be given a series of options.  You can remove
  36. extra spaces, delete REMarks, and combine lines.  The fourth
  37. option gives you the ability to protect a line or group of lines
  38. from being "Squished."  Lines entered under this option are
  39. totally ignored by "Squish."
  40.      "Squish" will then read in the program to check for lines
  41. that are referenced and proceed to work on it.  The display will
  42. update constantly to show, in color (or monochrome), what
  43. "Squish" is doing, and where.
  44.      When "Squish" is done, it will allow you to enter the
  45. "Squished" program for examination.  I suggest you then do a
  46. quick RENUMber and reSAVE the program under another filename.
  47.      When you are finished, you will have a neatly renumbered
  48. program that is not only much shorter than the original (usually
  49. by a few K), but will execute faster.  All in all, "Squish" is
  50. quite a useful utility.
  51.  
  52. VARIABLES;
  53.      A: Temporary numeric storage.
  54.      A$: Current program line being Squished.
  55.      AZ: Screen line on which current program line is displayed.
  56.      C$: Contains lines that have been combined.
  57.      D: Length of a reserved word being searched for.
  58.      DS: The maximum number of user protected lines.
  59.      DT: Set to 1 if current line contains a DATA statement.
  60.      G1 - G6: A position in A$ at which INSTR starts searching.
  61.      HH: Miscellaneous.
  62.      I$: Name of a DEF FN to convert a string input into a single upper
  63.                case letter.
  64.      IP$: Set to "Y" if REM statements are to be deleted.
  65.      J$: Storage for A$ as it is being reconstructed.
  66.      LN: Current line number being processed.
  67.      L$, L1$: Current character of A$ being processed.
  68.      N$: Set to STR$(LN).
  69.      P: Set to 1 the first time a quote is encountered in a PRINT
  70.                statement.  Set to 0 when second quote or end of
  71.                line is encountered.  While P equals 1, all
  72.                compression functions are cancelled.
  73.      PJ: Points to the current line in PRO(*) being tested.
  74.      PP: Set to 1 minus the location of the first character in a
  75.                program line following the line number.
  76.      PV: Number of protected lines entered.
  77.      PRO(*): Optional protected line numbers specified by user.
  78.      Q$: Used in an INKEY$ loop.
  79.      R: Number of line numbers referenced in REF(*).
  80.      RD: Total number of REM statements deleted.
  81.      RE: Total number of lines combined.
  82.      REF(*): Number of program lines that can be referenced.
  83.      S,S1: Miscellaneous.  Used in sort routine.
  84.      SD: Total number of spaces deleted.
  85.      SQ$: SAVE filename for Squished program.
  86.      SV$: SAVE filename for Squished program.
  87.      T,T1-T2: Miscellaneous.
  88.      V$: The current program line stripped of its line number.
  89.      X: Set equal to PP.
  90.      XC$: Set to "Y" if lines are to be combined.
  91.      XS$: Set to "Y" if extra spaces are to be deleted.
  92.      XP$: Set to "Y" if user wishes to protect lines.
  93.      ZC: Position on line AZ to print L$.
  94.  
  95.  
  96. 2/9/83 Patches, enhancements, etc. by Herb Shear
  97.  
  98. The R pointer can no longer lag behind allowing referenced REM and '
  99.   statements to be deleted.
  100. Trailing ' no longer added on nonnull referenced lines.
  101. RESTORE & RETURN references to a line now protect the line.
  102. Constructs like X=IGOTO+35 no longer protects line 35.
  103. Indentation was preserved even when combining.
  104. The deblanking tests were extended to close up constructs such as
  105.   A( I ),  etc.
  106. Goofs in naming the input file are now handled in a friendly fashion
  107.   instead of repeating the entire input session over again.
  108.  
  109.       Users should take note of the instructions to use SAVE"-----",A
  110. files as input.  Squish is tuned to the interpreter's output which is a
  111. subset of valid input forms.  Lowercase, blanks preceding line numbers
  112. and `GO TO xxx' are not handled properly by Squish.
  113.