$OPTIONS Statement
Sets the compiler mode for the current code module. This changes the types, names and locations of the items generated by the BASIC command, or the Reality version to emulate at runtime.
Syntax
$OPTIONS [ compiler-option || reality-version ]
Syntax elements
compiler-option One of the following keywords, specifying the required compiler option:
EXEC.OBJBASIC generates an executable (platform-specific) item with the same name as the source item in the dictionary of the file. No deliverable (platform-independent) item is generated unless the DEL.OBJ option is also selected (in a separate $OPTIONS statement), or the (R option is used when running the BASIC command.
If you specify this option, you only need to catalog your program once. When you recompile, the executable item referenced by the command definition item is overwritten.
DEL.OBJBASIC generates a deliverable (platform-independent) item in the data section containing the source code in addition to the executable item (if any). This item has the same name as the source item, but with a $ (or £) prefix.
This option has no effect unless either the EXEC.OBJ option or the EXEC.BASIC.OBJ environment option is also selected.
If neither of these options is set, BASIC generates just a deliverable object (with a $ or £ prefix) in the data section.
reality-version One of the following keywords, specifying the required runtime version:
V9.0
V9.1
V10.0
V11.0
V12.0
V14.0
V14.1
V14.2
V15.0
V15.1
V15.2
The leading "V" may be in upper or lower case.
Comments
A separate $OPTIONS statement is required for each compiler option that you wish to set.
A separate $OPTIONS statement is required to set the Reality runtime version. You can change the runtime version as many times as you wish in your program module; each occurrence overrides the previous one, taking effect from that point on. In particular, you can make local changes to the runtime version, overriding that specified in a global include item.
The $OPTIONS statement also allows you to set the compatibility mode for the current code module. Refer to MultiValue Compatibility for details.
Unless used in an automatically included module, the effect of a $OPTIONS statement is local to the module in which it appears. If used in a subroutine, any previous $OPTIONS settings are restored on on return to the calling module.
Runtime version
The runtime behaviour of a DataBasic program or subroutine is determined by a combination of two factors:
-
The run-time version embedded in the compiled code. This normally depends on the compiler used, but can be changed with the $OPTIONS statement.
Note
You can only change the run-time version with $OPTIONS if you compile with the V14.1 compiler or later. Also, programs compiled in this way will only run on Reality V14.1 or later.
-
The MultiValue compatibility mode (if any) set with $OPTIONS statement (see MultiValue Compatibility).
There are several reasons why you might wish change these settings (for all your programs or for a particular code module). These include:
-
You are an existing Reality customer who wishes upgrade to the latest version, but to maintain a previous runtime compatibility level to ensure that the earlier code continues to function as before. In this case, you would either compile using the appropriate version of the compiler, or set the Reality version using the $OPTIONS statement.
-
You are an existing Reality customer who wishes to enhance part of an existing application to make use of a new syntax or feature, but need to ensure that the earlier code continues to function as before. In this case, you would either compile your application using the appropriate version of the compiler, or set the Reality version using the $OPTIONS statement. However, the parts of the application that use the new features would be in separate code modules that use the $OPTIONS statement to select the newer Reality version.
-
You are migrating an existing MultiValue customer application to Reality. In this case, you would use the $OPTIONS statement to set the required MultiValue compatibility mode.
-
You are an existing Reality customer who has MultiValue applications that were migrated to an earlier version of Reality. In this case, you could user $OPTIONS statements to set both the Reality version and the MultiValue compatibility mode.
See also
BASIC command, EXEC.BASIC.OBJ environment option, $OPTIONS statement (MultiValue compatibility).