The $MODE directive enables language options for improved compatibility with other multi-value databases.
$MODE option
where
option is the feature to be turned on
The available options are:
DEFAULT | Turn off all options. |
CASE.SENSITIVE | Enables case sensitivity for names of labels, variables and user defined functions. |
COMPATIBLE.APPEND | Modifies the behaviour of the append modes of the S<f,v,sv> assignment operator, the INS statement and the INSERT() and REPLACE() functions to match that of other multivalue products. |
COMPOSITE.READNEXT | Modifies how a READNEXT statement handles exploded select lists. |
FOR.STORE.BEFORE.TEST | Stores the new value of the control variable in a FOR/NEXT construct before testing the end condition. |
OPTIONAL.FINAL.END | Suppresses the warning message if there is no END statement at the end of the program. |
PICK.ENTER | Pick style processing of ENTER. |
PICK.ERRMSG | Pick style syntax for STOP and ABORT. |
PICK.JUMP.RANGE | Causes the ON GOSUB and ON GOTO statements to continue at the next statement if the index value is out of range. |
PICK.MATRIX | Create Pick style matrices. See the COMMON and DIMENSION statements for a discussion of the implications of this mode. |
PICK.READ | Causes READ, READL, READU, READV, READVU and READVL statements to take on the Pick style behaviour in which the target variable is left unchanged if the record is not found. |
PICK.SUBSTR | Causes substring assignment operations to take on the Pick style behaviour in which the variable is extended by adding trailing spaces if the region to be overwritten is beyond the end of the current string value. |
PICK.SUBSTR.ASSIGN | Causes substring assignment operations to take on the full Pick style behaviour as described under Assignment Statements. Setting this mode overrides the PICK.SUBSTR mode. |
PRCLOSE.DEFAULT.0 | PRINTER CLOSE defaults to printer 0 rather than closing all printers. |
STRING.LOCATE | Numeric data in right aligned LOCATE is not treated as a special case. |
TRAP.UNUSED | Displays a warning about variables that are assigned a value but never used. |
UNASSIGNED.COMMON | Variables in common blocks are created unassigned instead of being initialised to zero. |
UV.LOCATE | UniVerse Ideal / Reality flavour style LOCATE. |
Prefixing a mode name (other than DEFAULT) with a minus sign turns off the named option.
Default modes can be set by creating a record named $BASIC.OPTIONS in the source file or in the VOC. Details of how to do this can be found with the description of the BASIC command.
Examples
$MODE TRAP.UNUSED
FUNCTION INV.CLI(INV.REC)
CLEINT.NO = INV.REC<4>
IF CLIENT.NO = '' THEN CLIENT.NO = INV.REC<18>
RETURN CLIENT.NO
END
The above program contains a typographical error in the spelling of the first use of CLIENT.NO. Because it has been compiled with the TRAP.UNUSED option, the compiler will display a warning message that the CLEINT.NO variable is assigned but never used.
PROGRAM INVOICE
FOR I = 1 TO 3
NEXT I
DISPLAY "I on exit = " : I
END
The above program displays the loop exit value as being 3 whereas the program below uses the FOR.STORE.BEFORE.TEST mode and displays the loop exit value as being 4.
$MODE FOR.STORE.BEFORE.TEST
PROGRAM INVOICE
FOR I = 1 TO 3
NEXT I
DISPLAY "I on exit = " : I
END
|