This program will reformat QuickBASIC modules by indenting the lines
according to the structure of the statements. For example, all lines found
between matching DO and LOOP statements will be indented a number of columns
more than the DO and LOOP statements. Of course, nested structures are
indented even further.
At the same time as the program is reformatting the module, it will
break apart any multiple statements that appear on the same line and that are
separated by a colon. However, the program is smart enough to realize that
a single line IF THEN structure cannot be broken apart without extreme care,
so this structure will not be separated.
One advantage of processing a file with this program is that improperly
matched statements are detected. Improper matching can happen if, for
example, you forget to type an END IF statement to match an IF statement. A
special comment line is placed in the file at the point where the error is
detected. The program will also cue you audibly when such an error is
QuickBASIC programs to be processed by this program must be saved in
text format and have the extension .BAS. To use the program, the command
line should be entered in the following format:
QBFMT filename(.BAS) [first-tab] [indentation]
where filename is the name of the QuickBASIC module
first-tab is the location of the first level of indentation
(default is column 8)
indentation is the level of indentation for successive structures
(default is 3)
The program will place line labels (symbolic AND numeric) flush with the left
margin. It will also place lone comments flush with the left margin. All
other lines will be indented according to structure.
The source code is included with this package, so you may modify the
program to meet your particular desires.