B-Format - version 1.12

by Graham Crow

The purpose of B-Format is to format Basic programs and improve legibility by:
	 indenting lines and structures,
	 splitting multi-statement lines,
	 inserting extra spaces,
	 inserting colon lines between procedures and functions,
and	 converting SWI numbers to names.

Introduction
Many Basic programs are 'packed' by eliminating nonessential spaces and by including as many statements as possible (separated by colons) on each line, and sometimes by using numbers instead of names for SWI calls. Whilst this saves space and may also reduce execution time, it does not make for legible listings! B-Format allows you to reverse the process and save the modified program under a different name. It also provides the means of improving the appearance of listings by indenting lines and structures (e.g. FOR...NEXT loops).

Using B-Format
Running the application installs an icon on the icon bar. Click Select on the icon bar icon to open the window.

Drag a Basic file from a directory viewer onto the window or the icon bar icon. Details of the current file appear in the top section of the window. Choose the option(s) you require and, in the case of indents, enter the number of spaces you require (between 0 and 9).

Click on Save if you wish to preserve your settings for next time you use B-Format.

Click on OK to begin processing; a progress report will be shown. The process may take some time, but it's quicker and more accurate than doing it by hand! Moreover, since B-Format is multitasking, you can work with other desktop applications whilst processing is taking place. You can pause processing by pressing <Escape>, after which you may elect to continue or abort.

Save the modified program by dragging the Basic icon to a filer window. Note that a default name (adding a -F suffix to the filename) is supplied. Also note that the modified program is automatically renumbered in increments of 1. Any referenced lines (GOTO, RESTORE) are preserved during renumbering. Any machine code (starting when the first non-space byte of a line or statement is '[' and ending when it is ']') is left untouched by B-Format. This means that you can temporarily protect sections of the program if you wish by enclosing them in square brackets.

Copyright  RISC User 1995