GENERATE

GENERATE

Top  Previous  Next

 

The GENERATE command generates a QMBasic include record from a dictionary.

 

 

Format

 

GENERATE file.name

 

where

 

file.nameis the name of the file for which the dictionary is to be processed.

 

 

Well structured QMBasic programs should not reference fields by field number but should instead use names defined using EQUATE tokens. The GENERATE command processes the dictionary of a named file and constructs an include record with an entry for each field. Optionally, it can also produce tokens for conversion codes associated with fields.

 

The generation process is controlled by an X-type record named $INCLUDE in the dictionary. The fields of this record are:

1X
2Target file name for include record. Defaults to BP.
3Record name to be produced for dynamic array style tokens. Defaults to file.name with .H suffix.
4Token prefix for dynamic array style tokens. Each token produced is constructed from the field name with this prefix. The prefix is separated from the field name by a dot.
5Text to be inserted into copyright line.
6"S" if only a single entry is to be included for any field. This is the default. "M" if multiple D-type records for the same field location should produce separate include tokens. If duplicates are not enabled, a warning message will be displayed if multiple dictionary entries are found defining the same field.
7Include conversion code tokens?  "N" omits conversion tokens. "Y" generates tokens for fields that have conversion codes. "A" generates tokens for all fields including those with a null conversion code.
8Type to create: D for dynamic array tokens (default), M for matrix tokens. Both may be used together in either order.
9Record name to be produced for matrix style tokens. Defaults to file.name with .MAT.H suffix.
10Matrix name for matrix style tokens. Defaults to file.name.
11Token prefix for matrix style tokens. Each token produced is constructed from the field name with this prefix. The prefix is separated from the field name by a dot.

 

If the $INCLUDE record does not exist, it will be created when GENERATE is first run for the file. A prompt will be issued for the type of tokens to be generated (field 8) and the prefix character to be inserted into fields 4 and/or 11. All other fields will be left empty except for field 1 (X).

 

When creating the matrix style include record for use with MATREAD, the matrix is dimensioned to have one more element than the highest field number referenced in the dictionary. This allows for the different ways in which normal and Pick style matrices handle unexpected fields.