The BASIC verb runs the QMBasic compiler.
Format
BASIC {file.name} {record.name...} {options}
where
file.name | is the name of the directory file holding the QMBasic source program. If omitted, the filename defaults to BP. |
record.name | is the name of the record within the file. Multiple record names may be specified. An asterisk as the only record.name compiles all programs in the file. If no names are specified and the default select list is active, the list will be used to specify the programs to be compiled. |
options | are as listed below. |
When using a select list or an asterisk to compile all programs, record names with a .H or .SCR suffix are ignored.
The following options are accepted by the BASIC verb
CHANGED | Compile only if the program is not already in the output file or the date and time of modification of the source program record as given in the operating system directory entry is later than that of the compiled program. Used in conjunction with a select list it enables all modified programs to be compiled with a single command. |
DEBUGGING | Include debugger control information in the compiled program. A program compiled in debug mode can be executed outside the debugger but will be slower than when compiled without the DEBUGGING option. |
LISTING | Generate a compiler listing record with a .LIS suffix. |
NOXREF | Omit cross reference tables from compiled program. This results in lower memory usage but run time error messages cannot identify source line numbers or variable names. |
XREF | Generates a compiler listing record as for the LISTING option but includes a cross-reference table of all variables and their use. |
The compiler output file, named as the source file but with a .OUT suffix, will be created automatically if it does not already exist.
@SYSTEM.RETURN.CODE is set to the number of programs successfully compiled. It will contain a negative error code in the event of a fatal error.
The $BASIC.OPTIONS VOC Record
Compiler options that you wish to use every time you run the QMBasic compiler can be placed in an X-type VOC record named $BASIC.OPTIONS. To apply these defaults only to programs stored in a specific file, place the $BASIC.OPTIONS record in that file. The compiler looks first in the source file and then, if no record has been found, in the VOC.
The first line of the record holds the type code X. The second and subsequent lines of this record should contain compiler option keywords from the list below. The keywords allowed are:
CATALOGUE {LOCAL | GLOBAL} | Automatically catalogues programs after compilation using the program name as the catalogue name. The LOCAL and GLOBAL keywords may be used to specify that the program is to be catalogued in the given mode instead of in the private catalogue. The $NO.CATALOGUE compiler directive can be used in specific program modules to override this action. Alternatively, the $CATALOGUE compiler directive in a program can set an alternative catalogue name or mode. |
DEBUGGING | Compiles the program in debug mode. |
DEFINE name {value} | Defines token name in the same way as the $DEFINE compiler directive. The value may be a number or a quoted string. If omitted, the token is assigned a null string as its value. |
LISTING | Generates a listing record in the compiler output file. |
MODE option.name | Sets the given compilation mode as described for the $MODE compiler directive. Multiple MODE lines must be used to set more than one option. |
NOCASE.STRINGS | Compiles the program with case insensitive string operations. See the $NOCASE.STRINGS compiler directive for more details. |
NOXREF | Compiles the program with no cross reference tables. This results in slightly lower memory usage but prevents QM producing detailed messages in the event of an error. |
WARNINGS.AS.ERRORS | Causes the compiler to treat warning messages as fatal errors. |
XREF | Generates a listing record in the compiler output file, including a cross-reference table of all variables and their use. |
Unrecognised keywords in this record are ignored.
Examples
BASIC PROGRAMS PROG1 LISTING
This command compiles the program in record PROG1 of the PROGRAMS file. A listing record is produced.
SELECT BP
BASIC CHANGED
This sequence of commands compiles all programs in the BP file which have been updated since they were last compiled. Note that the compiler will omit all records with names ending with .H or .SRC, the two standard suffix codes for include records.
See also:
CATALOGUE, DELETE.CATALOGUE, MAP
|