home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsd / evntshell / Tools / !Shrink_PD / !Help < prev    next >
Encoding:
Text File  |  1991-08-29  |  11.5 KB  |  325 lines

  1.    !Shrink_PD - a Public Domain BASIC program compactor
  2.    ====================================================
  3.  
  4.   The purpose of !Shrink_PD is to provide a simple method
  5. of squashing BASIC programs by the usual methods of
  6. shortening variable/procedure/function names, deleting
  7. blank lines, REMs and spaces and concatenating lines (ie
  8. joining them together!).
  9.  
  10.   The procedure to squash a BASIC program is then:
  11.  
  12. 1) Load the !Shrink_PD if it is not already loaded.  It
  13.     will appear on the icon bar.
  14. 2) The main options window may be opened by clicking on
  15.     the icon.
  16. 3) Drag the BASIC file either to the icon on the icon-bar
  17.     or to the main options window.  If the main options
  18.     window is not open then it will opened automatically.
  19. 4) Amend the filename to save the squashed as and/or drag
  20.     the file to the destination directory, or just click
  21.     OK to overwrite the original program.
  22. 5) Wait while the program is squashed.
  23.  
  24. Notes for Public Domain version 1.01
  25.  
  26.   i) The 'Other options' radio icon is non-functional, use
  27.       the window's 'toggle size icon' instead to access
  28.       and modify the other options.
  29.  ii) The 'Save options' button is non-functional.
  30. iii) The 'Concatenate lines' option is non-functional.
  31.  iv) The 'Multi-task' option is non-functional.
  32.  
  33. ----------------------------------------------------------
  34. OPTIONS
  35. -------
  36. c       : concatenate lines            : not implemented
  37. l       : remove blank lines           : implemented fully
  38. -p <str>: don't shorten if start <str> : implemented fully
  39. r       : remove REM statements        : implemented fully
  40. *       : remove *| statements         : implemented fully
  41. s       : remove spaces                : implemented fully
  42. -v      : verbose                      : implemented
  43. A       : ASC("<char>") -> <number>    : implemented fully
  44. D       : affect DATA statements       : implemented fully
  45. F       : shorten function names       : implemented fully
  46. I       : represent integers shortest  : implemented fully
  47. M       : multi-task                   : not implemented
  48. P       : shorten procedure names      : implemented fully
  49. S       : SYS "<name>" -> SYS <number> : implemented fully
  50. V       : shorten variable names       : implemented fully
  51.  
  52. Concatenating lines
  53. -------------------
  54.   By default lines within a program are joined together
  55. wherever possible.  Exceptions include lines which are
  56. referenced by GOTO,GOSUB,etc. statements, DATA statements
  57. and comments.
  58.   Use -c to prevent lines from being concatenated.
  59.  
  60. Blank lines
  61. -----------
  62.   By default blank lines within a program (whether blank
  63. to begin with or becoming blank during shrinking) are
  64. removed.  The exception to this are those lines which are
  65. directly referenced in GOTO and RESTORE statements as a
  66. tokenised line number.
  67.   Use -l to prevent blank lines from being deleted.
  68.  
  69. Preserving names
  70. ----------------
  71.   Use -p followed by a string of characters which
  72. represents the start sequence of characters of variable/
  73. procedure/function names which are not to be shortened.
  74.   This is useful if you are using libraries and don't want
  75. names starting with '_Wimp', for example, being shortened
  76. as they reference variable names and procedure/function
  77. calls to those libraries.
  78. example: using -p _Wimp
  79.          10 PROC_Wimp_InitTask
  80.          20 PROC_MyInit
  81. becomes: 10 PROC_Wimp_InitTask
  82.          20 PROCA
  83.  
  84. REM statements
  85. --------------
  86.   By default a REM and all following text on that line is
  87. removed.
  88.   Use -r to prevent REM statements from being deleted.
  89.  
  90. *| statements
  91. -------------
  92.   These are the equivalent of a REM but for a star command
  93. instead.  By default a *| and all following text on that
  94. line is removed.
  95.   Use -* to prevent *| statements from being deleted.
  96.  
  97. Spaces
  98. ------
  99.   By default all unnecessary spaces within a line are
  100. removed.
  101.   Use -s to prevent spaces from being deleted.
  102.  
  103. Progress display
  104. ----------------
  105.   By default there is no output from !Shrink.  Use -v to
  106. switch the 'verbose' option on.  This displays the progess
  107. of the compaction on the BASIC file.  There are three
  108. passes, and on each pass the line number currently being
  109. processed is displayed.
  110.  
  111. Converting ASC("<char>") to a number
  112. ------------------------------------
  113.   By default whenever the token ASC occurs on a line, an
  114. attempt will be made to evaluate it.  !Shrink can handle
  115. both ASC"<char>" and ASC("<char>"), and if there is more
  116. than one character between the doubele quotes, then only
  117. the first character is used, the others being ignored.
  118.   Use -A to prevent the token ASC being evaluated.
  119. example: 10 space = ASC" "
  120. becomes: 10 space = 32
  121.  
  122. DATA statements
  123. ---------------
  124.   By default the text following a DATA keyword is treated
  125. as though it were on a 'normal' line, and is shrunk as
  126. dictated by the other options.  The exception to this is
  127. that on the first pass (when creating the name tables), no
  128. attempt will be made to parse the DATA line, so only names
  129. which occur on 'normal' lines and on the DATA line are
  130. shrunk (is requested), all other names are left as found.
  131.   Use -D to prevent the DATA line being affected.
  132. example: 10 var_names = 2
  133.          20 DATA var_names,"Fred",Jim
  134. becomes: 10 A = 2
  135.          20 DATA A,"Fred",Jim
  136.  
  137. Function names
  138. --------------
  139.   By default function names are shortened.
  140.   Use -F to prevent function names from being shortened.
  141.  
  142. Integers
  143. --------
  144.   By default any integer (binary, decimal or hex) numbers
  145. are converted to their shortest form.  This is done by
  146. representing numbers from 0 to 99999999 in decimal and
  147. numbers geater than 99999999 in hex.
  148.   Use -I to prevent integers from being converted.
  149. example: 10 big_number   = 199999999
  150.          20 small_number = &10
  151.          30 binary_value = %1111
  152. becomes: 10 big_number   = &BEBC1FF
  153.          20 small_number = 16
  154.          30 binary_value = 15
  155.  
  156. Procedure names
  157. ---------------
  158.   By default procedure names are shortened.
  159.   Use -P to prevent procedure names from being shortened.
  160.  
  161. Converting SYS "<name>" to a SYS <number>
  162. -----------------------------------------
  163.   By default whenever the token SYS occurs on a line, and
  164. it is followed by a string, the string is passed to the
  165. OS through OS_SWINumberFromString.  If valid, the string
  166. will be replaced by the relevant number.
  167.   Note that you may have to load in a module that contains
  168. swi's before using !BasShrink, so that all swi names are
  169. recognised.
  170.   Use -S to prevent the name being converted to a number.
  171. example: 10 SYS "OS_WriteN"
  172. becomes: 10 SYS 70
  173.  
  174. Variable names
  175. --------------
  176.   By default variable names are shortened.
  177.   Use -V to prevent variable names from being shortened.
  178.  
  179. ----------------------------------------------------------
  180. HISTORY
  181. -------
  182. Version 0.21 : 10-Jul-91
  183.   What !BasShrink will do:
  184.  * Variable/FN/PROC names are shortened
  185.  * Blank lines are removed
  186.  * Preserving names using the -p <str> option
  187.  * REM and *| statements are removed
  188.  * Unnecessary spaces are removed
  189.  * Representing integers as their shortest form
  190.  
  191. Version 0.22 : 11-Jul-91
  192.   Bug fix: Blank lines, colons at end of line and assembly
  193. language comments now handled correctly.
  194.   Rewrite: The integer conversion routine now uses SWIs.
  195.  
  196. Version 0.23 : 12-Jul-91
  197.   ARMcode: The function getName.
  198.   Bug fix: BASIC keyword ASC valid in assembly language.
  199.   Bug fix: in procedure addStringToLine
  200.   Bug fix: Some comments were left in assembly language.
  201.  
  202. Version 0.24 : 12-Jul-91
  203.   Rewrite: Tidying up the code which shrinks the lines.
  204.   Bug fix: Removing spaces between integer variable names.
  205.  
  206. Version 0.25 : 13-Jul-91
  207.   SWI name to number now works (are you happy now Mark!).
  208.   Bug fix: A bug was introduced when decoding ASC keyword.
  209.  
  210. Version 0.26 : 15-Jul-91
  211.   ARMcode: Building short name from its index position.
  212.   Rewrite: Tidying up code dealing with variable names.
  213.   Problem: Decoding mnemonic TEQ doesn't work properly.
  214.  
  215. Version 0.27 : 16-Jul-91
  216.   As a fudge, 'T' is considered as a mnemonic instruction.
  217.   ARMcode: Searching for a name in the linked list.
  218.   Bug fix: No terminating double quote gave an error.
  219.  
  220. Version 0.28 : 23-Jul-91
  221.   Bug fix: More BASIC keywords allowable in assembler.
  222.   Bug fix: Blank lines not removed if referenced by GOTO.
  223.  
  224. Version 0.29 : 23-Jul-91
  225.   ARMcode: Functions AddName and FindLineNumber.
  226.   Rewrite: CASE statement for checking assembly language.
  227.   Rewrite: The routines which create the name tables.
  228.  
  229. Version 0.30 : 28-Jul-91
  230.   Bug fix: Decimal numbers beginning with a decimal point.
  231.   Problem: Certain assembler mnemonics are not recognised.
  232.   Update : If first line of program begins with REM, then
  233. ' ¤¤¤ Squished by Lofty's !Shrink vsn <vsn> on <date> ¤¤¤'
  234. is added to the end of that line.
  235.   The option 'ASC"<char>" -> number' has been implemented.
  236.  
  237. Version 0.31 : 31-Jul-91
  238.   The option 'affect DATA' has been implemented.
  239.  
  240. Version 0.32 : 02-Aug-91
  241.   Update : The first line is only amended now if the line
  242. is a REM and does not already contain '¤¤¤...'.
  243.  
  244. Version 0.33 : 09-Aug-91
  245.   Bug fix: Tokens are now fully recognised within assembly
  246. language.
  247.   Rewrite: The routines which shorten lines.
  248.  
  249. Version 0.34 : 10-Aug-91
  250.   Update : The first line is updated with '¤¤¤...', with
  251. the previous '¤¤¤...' being removed if present.
  252.  
  253. Version 1.00 : 12-Aug-91
  254.   Public Domain version ready for release.
  255.  
  256. Version 1.01 : 28-Aug-91
  257.   Update : The templates and icons for the front-end.
  258.  
  259. ----------------------------------------------------------
  260.  
  261. COPYRIGHT
  262. ---------
  263. !Shrink_PD and !BasShrink are designed and written by
  264. John 'Lofty' Wallace, with help from Mark Bright and
  265. Stuart Hickinbottom.
  266.  
  267. Version 1 of this program has been placed into the public
  268. domain.  It may be freely copied and distributed for non-
  269. profit making purposes (a small charge to cover cost of
  270. distribution is allowed, however), so long as the code is
  271. not altered (apart from customising !Run/!Boot files) and
  272. this text file remains present and unaltered.
  273.  
  274. The source code remains copyright © John Wallace and
  275. Architype Software, 1991.
  276.  
  277. Version 2 of !BasShrink, which allows concatenation of
  278. lines, is available at £5.00 (this includes the full
  279. source code).
  280.  
  281. Version 3 of !BasShrink will soon be available, which will
  282. multi-task under the desktop.  This will be £5.00, with a
  283. discount of £2.50 for version 2 owners.
  284.  
  285. Due to the continued development of !BasShrink, there will
  286. be new versions made available from time to time (for both
  287. version 2 and 3).  Registered users will be notified of
  288. major new releases and can receive the latest version by
  289. sending a formatted disc and a cheque for £1.00 (to cover
  290. adminstration and P&P costs).
  291.  
  292. End User Licence Conditions
  293. ---------------------------
  294.   'Software' refers to the source code for all versions of
  295. !BasShrink, !Shrink_PD and related software.
  296.   'User' refers to the person who has purchased the
  297. software.
  298.   The conditions of use are:
  299.   1. Only the User may use the Software, and must not make
  300. the Software available to any third party by way of gift
  301. or loan or hire.
  302.   2. Sections of the Software can only be included within
  303. PUBLIC DOMAIN programs written by the User, and they must
  304. include in a readme file these End User Licence Conditions
  305. stating clearly which sections of the User's program the
  306. conditions covers (ie those taken from the Software).
  307.   3. If the User wishes to include sections of the
  308. Software in programs they wish to sell, permission must
  309. be sort from Architype Software (by writing to the address
  310. below) for a distribution licence.
  311.   4.  No liability will be accepted by John Wallace or
  312. Architype Software for the suitability of the software for
  313. any purpose or for any loss due to the use or mis-use of
  314. the Software.
  315.  
  316. If you have any queries/suggestions then write to:
  317.  
  318. John Wallace
  319.  Architype Software
  320.   54 Parkes Hall Road
  321.    Woodsetton
  322.     Dudley
  323.      West Midlands
  324.       DY1 3SR
  325.