home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-26 | 4.6 KB | 111 lines | [TEXT/MSWD] |
- ZFormat© 1.0
-
- Michael Lininger
- Lininger Technology
-
- Some notes about the ZForamt© application:
-
- ZFormat© is a utility for ZBasic© programmers that I wrote one afternoon to help
- solve a problem I was having. I was working on a very large program 16000+
- lines of code. And these 16000+ lines of code had been copied and pasted from
- many pieces of source code, some of them typed in while in the ZBasic© Editor
- other lines were entered with one text editor or another. Well since the
- ZBasic© 5.0 editor does not handle tabs very well, things could and did get very
- messy; in terms of source code format and readability. Thus, the creation of
- ZFormat©.
-
- ZFormat© will take your source code file and will analyze it and reformat it
- using Tabs, indenting DO's, WHILE's, FOR's, SELECT's and so on. I was able to
- reduce the size of the source code text file for my application by 84k, (was
- 486k and was reduced to 402k) by preforming a reformat of the source code,
- removing all those spaces and replacing them with nice neat tabs. Plus it makes
- the source code a lot more readable.
-
- Note: This will not reduce the size of your final application, ZBasic© filters
- all tabs and spaces before it compiles, ZFormat© is designed to help make
- reading and modifying your source code a little easier.
-
- Note: ZBasic© 5.0 does not handle tabs, so when you list your source code in
- the ZBasic© environment it will show with only 1 space (indent) per tab. ZBasic©
- 5.0 treats a tab like a space (this is how text can become so jumbled; jumping
- from a text editor to the ZBasic© 5.0 environment (mixing spaces and tabs).
- This has been fixed in the pending ZBasic© 6/7.0
-
- ' This is how code would look in the ZBasic© 5.0 environment
- LONG FN Sample(a%,b%,c%)
- a% = b% + c%
- END FN = a%
-
- ' This is how code would look in a text editor set for 3 spaces per
- ' tab or in Z6/7.
- LONG FN Sample(a%,b%,c%)
- a% = b% + c%
- END FN = a%
-
- How to run ZForamt©?
-
- Always make a copy of your source code before your run ZForamt© on it.
- -------------------------------------------------------------------- Even though
- ZForamt© does not alter the original file, things like power failures and so
- could happen leaving files open and damaged. ZForamt© will read in your
- original source file and will generate a new separate source file that is
- reformatted.
-
- 1. Launch ZForamt©
-
- 2. A standard SFPGETFILE dialog box will be displayed. This has the same
- purpose as every SFPGetFile dialog box in every application. You use it to
- select the ZBasic© (TEXT) source file that your want to reformat. Locate and
- double click on it.
-
- 3. Three check boxes have been added to this SFPGetFile dialog box. These allow
- you to control a few aspects of ZFormat©.
-
- _ Show Processed Lines - will show each line in the process window as it is
- analyze. (slows process time down)
-
- _ Show Line Count - will show the number of lines processed so far and how long
- ZForamt© has been working (in seconds).
-
- _ Remove 'full line' REMarks - will delete any 'full line' REM statements. Any
- line that starts with:
- '
- :'
- REM
- will be deleted from the new reformatted text.
-
- 4. Once you have selected your control options and selected a file to reformat
- a progress window will be displayed. You can push this window to the background
- (MF and SYS7) and go do something else while the file is being reformatted.
- Right now I time ZFormat© at about 52 lines per seconds on a CI, so larger files
- will take a minute or two to complete.
-
- **To terminate a reformatting operation once it is underway hold down the option
- key.
-
- 5. Your new reformatted file will have the extension <filename> new.
-
-
-
- ZForamt© is provided AS IS, you use at your own risk.
-
- ZForamt© has worked for me very well, though I have not tested it extensively
- with all types of ZBasic© source listings. I am providing documented source
- code, so if a problem should arise, you can update the source to fix whatever is
- not being analyzed/formatted correctly.
-
- ZForamt© may not be distributed or bundled with any other software with out my
- express written consent. You may use it for your personal use only. ZForamt©
- may not be redistributed to other online services or BBS. AOL (Ariel Publishing
- download area) is the only source for this code.
-
- ZForamt© will not work with the following:
-
- Token saved source code Source code that contains line numbers.
- Source code that does not have keywords separated by a space.
- Source code that allows lowercase keywords.
-
- If your new reformatted source listing is exceptionally big or things do not
- line up correct, this is a sure sign you are missing some type of END STATEMENT
- or have the keyword typed in lowercase or misspelled.
-