home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / U-Z / 'Z' Basic 5.0x (ML) / zFormat ƒ / ZFormat Docs < prev    next >
Encoding:
Text File  |  1992-10-26  |  4.6 KB  |  111 lines  |  [TEXT/MSWD]

  1. ZFormat© 1.0
  2.  
  3. Michael Lininger
  4. Lininger Technology
  5.  
  6. Some notes about the ZForamt© application:
  7.  
  8. ZFormat© is a utility for ZBasic© programmers that I wrote one afternoon to help
  9. solve a problem I was having.  I was working on a very large program 16000+
  10. lines of code.  And these 16000+ lines of code had been copied and pasted from
  11. many pieces of source code, some of them typed in while in the ZBasic© Editor
  12. other lines were entered with one text editor or another.  Well since the
  13. ZBasic© 5.0 editor does not handle tabs very well, things could and did get very
  14. messy; in terms of source code format and readability.  Thus, the creation of
  15. ZFormat©.
  16.  
  17. ZFormat© will take your source code file and will analyze it and reformat it
  18. using Tabs, indenting DO's, WHILE's, FOR's, SELECT's and so on.  I was able to
  19. reduce the size of the source code text file for my application by 84k, (was
  20. 486k and was reduced to 402k) by preforming a reformat of the source code,
  21. removing all those spaces and replacing them with nice neat tabs.  Plus it makes
  22. the source code a lot more readable.
  23.  
  24. Note:  This will not reduce the size of your final application, ZBasic© filters
  25. all tabs and spaces before it compiles, ZFormat© is designed to help make
  26. reading and modifying your source code a little easier.
  27.  
  28. Note:  ZBasic© 5.0 does not handle tabs, so when you list your source code in
  29. the ZBasic© environment it will show with only 1 space (indent) per tab. ZBasic©
  30. 5.0 treats a tab like a space (this is how text can become so jumbled; jumping
  31. from a text editor to the ZBasic© 5.0 environment (mixing spaces and tabs).
  32. This has been fixed in the pending ZBasic© 6/7.0
  33.  
  34.  ' This is how code would look in the ZBasic© 5.0 environment
  35.  LONG FN Sample(a%,b%,c%)
  36.   a% = b% + c%
  37.  END FN = a%
  38.  
  39.     ' This is how code would look in a text editor set for 3 spaces per
  40.     ' tab or in Z6/7.
  41.     LONG FN Sample(a%,b%,c%)
  42.         a% = b% + c%
  43.     END FN = a%
  44.  
  45. How to run ZForamt©?
  46.  
  47. Always make a copy of your source code before your run ZForamt© on it.
  48. -------------------------------------------------------------------- Even though
  49. ZForamt© does not alter the original file, things like power failures and so
  50. could happen leaving files open and damaged.  ZForamt© will read in your
  51. original source file and will generate a new separate source file that is
  52. reformatted.
  53.  
  54. 1. Launch ZForamt©
  55.  
  56. 2. A standard SFPGETFILE dialog box will be displayed.  This has the same
  57. purpose as every SFPGetFile dialog box in every application.  You use it to
  58. select the ZBasic© (TEXT) source file that your want to reformat.  Locate and
  59. double click on it.
  60.  
  61. 3. Three check boxes have been added to this SFPGetFile dialog box.  These allow
  62. you to control a few aspects of ZFormat©.
  63.  
  64. _ Show Processed Lines - will show each line in the process window as it is
  65. analyze.  (slows process time down)
  66.  
  67. _ Show Line Count - will show the number of lines processed so far and how long
  68. ZForamt© has been working (in seconds).
  69.  
  70. _ Remove 'full line' REMarks - will delete any 'full line' REM statements.  Any
  71. line that starts with:
  72.                 '
  73.                 :'
  74.                 REM
  75.                         will be deleted from the new reformatted text.
  76.  
  77. 4.  Once you have selected your control options and selected a file to reformat
  78. a progress window will be displayed.  You can push this window to the background
  79. (MF and SYS7) and go do something else while the file is being reformatted.
  80. Right now I time ZFormat© at about 52 lines per seconds on a CI, so larger files
  81. will take a minute or two to complete.
  82.  
  83. **To terminate a reformatting operation once it is underway hold down the option
  84. key.
  85.  
  86. 5. Your new reformatted file will have the extension  <filename> new.
  87.  
  88.  
  89.  
  90. ZForamt© is provided AS IS, you use at your own risk.
  91.  
  92. ZForamt© has worked for me very well, though I have not tested it extensively
  93. with all types of ZBasic© source listings.  I am providing documented source
  94. code, so if a problem should arise, you can update the source to fix whatever is
  95. not being analyzed/formatted correctly.
  96.  
  97. ZForamt© may not be distributed or bundled with any other software with out my
  98. express written consent.  You may use it for your personal use only.  ZForamt©
  99. may not be redistributed to other online services or BBS.  AOL (Ariel Publishing
  100. download area) is the only source for this code.
  101.  
  102. ZForamt© will not work with the following:
  103.  
  104. Token saved source code Source code that contains line numbers. 
  105. Source code that does not have keywords separated by a space. 
  106. Source code that allows lowercase keywords.
  107.  
  108. If your new reformatted source listing is exceptionally big or things do not
  109. line up correct, this is a sure sign you are missing some type of END STATEMENT
  110. or have the keyword typed in lowercase or misspelled.
  111.