$MODE Compiler Directive

Top  Previous  Next

 

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:

DEFAULTTurn off all options.
CASE.SENSITIVEEnables case sensitivity for names of labels, variables and user defined functions.
COMPATIBLE.APPENDModifies 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.READNEXTModifies how a READNEXT statement handles exploded select lists.
FOR.STORE.BEFORE.TESTStores the new value of the control variable in a FOR/NEXT construct before testing the end condition.
OPTIONAL.FINAL.ENDSuppresses the warning message if there is no END statement at the end of the program.
PICK.ENTERPick style processing of ENTER.
PICK.ERRMSGPick style syntax for STOP and ABORT.
PICK.JUMP.RANGECauses the ON GOSUB and  ON GOTO statements to continue at the next statement if the index value is out of range.
PICK.MATRIXCreate Pick style matrices. See the COMMON and  DIMENSION statements for a discussion of the implications of this mode.
PICK.READCauses 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.SUBSTRCauses 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.ASSIGNCauses 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.0PRINTER CLOSE defaults to printer 0 rather than closing all printers.
SELECTVChanges the action of SELECT to be as for SELECTV.
STRING.LOCATENumeric data in right aligned  LOCATE is not treated as a special case.
TRAP.UNUSEDDisplays a warning about variables that are assigned a value but never used.
UNASSIGNED.COMMONVariables in common blocks are created unassigned instead of being initialised to zero.
UV.LOCATEUniVerse 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