INMC 80 News

  

September 1980 – January 1981 · Issue 2

Page 44 of 59

Parkinson Basic Toolkit

a software review by Richard Beal

The author of NAS-DIS, David Parkinson has now produced a “Basic Toolkit”. It is used with the Nascom 8K ROM Basic to provide a number of additional direct commands which are useful to the serious programmer. It is no use to people who just RUN Basic programs, but is very useful if you write new programs or alter old ones.

Eleven additional direct commands are provided. Each consists of a full stop ‘.’, followed by a letter, and are as follows:

.A Auto line number. (Initial line number and increment can be specified.)
.C Cross reference listing. (See below.)
.D Delete a block of lines.
.F Find a string. (See below.)
.H Convert a Hexadecimal number to decimal.
.K Kill all unnecessary spaces in the program to save space, and optionally delete all REM statements.
.N   )
.X   )
.U   )
Similar to the same NAS-SYS commands, but used inside Basic.
.R Renumber. (See below.)
. (By itself) return to NAS-SYS.

The three most interesting commands are Cross reference, Find and Renumber.

Cross reference

Number cross reference (.C), lists every line number used and shows every line in the program where that line is referred to. Then it does the same for every function used, string array, string, numeric array, and finally every ordinary variable. The LINES command is used to control how many lines appear at a time, and the WIDTH also operates if you are using a printer. This command is most useful for checking the use of variables in a program, and often helps find errors, such as a variable which is only refered to once because it was spelt incorrectly.

Find

Find (.F), displays each line which contains a string which is to be searched for. The search can be made to start at a specified line number, and the string to be searched for can contain “wild” values.

Renumber

Renumber (.R), will normally renumber the whole program and you can specify the initial line number and increment if you wish (default is from 10 in 10s). However, an excellent feature is that you can renumber just part of a program. This enables you to have each subroutine start at a round number, such as a multiple of 1000. For example, to renumber a subroutine which starts at 7800 to 8000, you might enter:

.R 8000 10 7800 8999

= Renumber starting at 8000, in increments of 10, the part of the program between lines 7800 and 8999. Naturally, any GOSUBs, GOTOs, etc, outside this area which refer to locations within the area are renumbered accordingly. Also, if Renumber detects any errors, such as jumps to lines which do not exist, it reports this and leaves the program unchanged.

To use the toolkit, you load it from tape at 1200H. Then you type E1200 and the toolkit relocates itself and cold starts Basic for you. It is still possible to warm start Basic, and to reserve memory at the top if you require. The toolkit only works with NAS-SYS and the Nascom ROM Basic.

Page 44 of 59