|Powered by QM on a Rpi server|
This article was originally published as a Tip of the Week.
In its default form, QM follows the general concepts of the "Information style" products initially defined by Prime Information and subsequently adopted by PI/open and, to some extent, UniVerse/Unidata in their default modes.
This article summarises some of the features available to improve compatibility with other multivalue products.
The $MODE compiler directive enables various language features. Most of these can, if the developer wishes, be enabled for just part of a program module but it is more usual to apply mode settings over the entire program.
See the QM Reference Manual for full details of the mode settings. Some of the more important ones are:
|$MODE CASE.SENSITIVE||Enables case sensitivity in names for labels, variables and user defined functions.|
|$MODE IMPLIED.STOP||Changes the implied RETURN at the end of a program module to be STOP.|
|$MODE OPTIONAL.FINAL.END||Makes the final END at the end of a program module optional.|
|$MODE PICK.ERRMSG||Makes STOP and ABORT work as in Pick style systems, referencing the ERRMSG file.|
|$MODE PICK.MATRIX||Changes from dynamically allocated dimensioned matrices with a zero element to statically allocated matrices with no zero element.|
|$MODE UV.LOCATE||Changes from the slightly illogical Information style definition of the IN clause of LOCATE to the semantics used by UV (and others).|
This compiler directive makes string comparisons case insensitive. Unlike $MODE which can appear anywhere in a program, affecting compilation from that point forwards, $NOCASE.STRINGS must appear before the first executable statement and applies to the entire program.
Although the compiler directives described above could be inserted separately into each program module, QM provides an easy way to define the modes just once in a record named $BASIC.OPTIONS.
If there is a $BASIC.OPTIONS record in the file holding the program source, this record applies to all programs in that file.
If there is no $BASIC.OPTIONS record in the program source file but there is one in the VOC file, this is used to set compiler options.
In either case, use of
$MODE DEFAULTin the program source code will revert to the default option settings of the compiler.
The $BASIC.OPTIONS record has an X in field 1 to comply with VOC record formats. The remaining fields contain various options to control the behaviour of the compiler. The more important ones are:
|CATALOGUE||Automatically catalogue the program on successful compilation. Qualifiers are available to set the cataloguing mode.|
|DEBUGGING||Compile the program in debug mode.|
|DEFINE token value||Define a token similarly to use of $DEFINE or EQUATE in the program source text.|
|MODE name||Equivalent to use of $MODE in the program source text.|
|NOCASE.STRINGS||Enabled case insensitive string operations.|
|WARNINGS.AS.ERRORS||Treat compiler warnings as errors.|