|
The $MODE directive enables language options for improved compatibility with other multivalue databases.
Format
$MODE option {, option...}
where
option is the feature to be turned on. Multiple comma separated option names may be given.
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. |
| HEADING.NO.EJECT | Makes the NO.EJECT mode of the QMBasic HEADING statement the default, suppressing the automatic page throw on setting a new heading. |
| IMPLIED.STOP | The QMBasic compiler normally inserts an implied RETURN at the end of a program, subroutine or function. Setting this option inserts an implied STOP for compatibility with other mutlivalue products. Class modules always insert a RETURN regardless of the setting of this option. |
| NO.ECHO.DATA | Suppresses echo of data for INPUT if it is taken from the DATA queue. |
| 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.SELECT | Changes the behaviour of SELECTV (and SELECT when $MODE SELECTV is in effect) when such that, if the default select list is active, that list is transferred into the target variable instead of building a new list. |
| 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. |
| STDFIL.SHARED | Enables use of the shared default file variable. |
| 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
|