tcl.bformat Verb: Access/TCL


Command tcl.bformat Verb: Access/TCL
Applicable release versions: AP 6.1
Category TCL (746)
Description formats a FlashBASIC or Pick/BASIC source program and update the source file with the formatted item.

The action of bformat is identical to blist, except that the output is not printed, but is filed into the source file overwriting the original source program.

file-name is any Pick/BASIC source file.

item-list is a list of program names, or an asterisk (*) for all items, or null if there is a select list active.

The bformat verb is table driven, like the BLIST verb. The table is stored in the messages file. The item-id of the control table is "BF" followed by a 4 character hexadecimal number. The table number is contained in line 4 of the verb definition. The default table number is 0, thus the default table item-id is "BF0000". The structure of the table is identical with the BLIST control table. The only default options are R for renumber, C for comment indent inhibit, and the numeric options for specifying the starting statement label number and increment. It is possible to specify the numeric options in the control table, and leave the R option as a run-time option. In this case, the numeric options need not be specified at run-time.
Syntax bformat {{item.list}|{*}} {(options}
Options r Renumber statement labels and all references to the labels (GOTO, GOSUB, RETURN TO).

n1-n2 Used with the R option, n1 specifies the new beginning statement label number, n2 specifies the increment between statement labels. Both n1 and n2 default to 10.

The R option is useful for renumbering a source program to make it easier to follow. If the R option is used, then a line containing only an exclamation point (!) and a statement label may be used to change the current new statement label number to the label specified on that line. This is true as long as the current statement label number is greater than what would be the next number (previous label number plus increment). This is useful when specific labels make the program easier to follow, such as at the beginning of subroutines, etc. Note: Certain forms of the GOTO, GOSUB, and RETURN TO statements will not be renumbered. This occurs when there is no blank between the key word and the destination label, e.g. GOTO20 will not be renumbered, but GOTO 20 will. Also, a mixture of numeric and alpha-numeric statement labels following an ON GOTO or ON GOSUB will fail to renumber any numeric labels past the first alpha-numeric label.
Related basic