Caché MultiValue Basic Reference
$OPTIONS
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Sets configuration options for MultiValue implementations.
Synopsis
$OPTIONS option
Arguments
option The name of a single option, or the names of multiple options separated by spaces. Option names are not case sensitive.
Description
The $OPTIONS statement provides emulation/compatibility options for the various “flavors” of MultiValue database systems for the current MVBasic program. There are two basic types of options:
An $OPTIONS statement may specify multiple option values, separating the values with a blank space. If you specify an emulation option, it must be the first option value specified.
Emulation Options
Each option sets the appropriate configuration values for that MultiValue implementation. The following option database system values are supported:
Cache
D3
IN2
INFORMATION
jBASE
MVBase
PICK
PIOpen
Prime
R83
POWER95
Reality
UDPICK
Ultimate
UniData
UniVerse
$OPTIONS sets the emulation for the duration of the current MVBasic program. Emulation is specific to the current account. An $OPTIONS statement can only specify one emulation option.
Both “Prime” and “INFORMATION” option values set an emulation of “INFORMATION.” An option value of “Default” sets an emulation of “CACHE”. You can determine the current emulation using the SYSTEM(1001) and SYSTEM(1051) functions.
You can set the systemwide MultiValue emulation for the current account using the CEMU command line command, as described in the Caché MultiValue Commands Reference.
D3 emulation, by default, provides variable names that are not case-sensitive. Use of such variables is not advised when interacting with Caché CSP variables, ZEN, and other InterSystems software, all of which uses case-sensitive variables. To make D3 emulation use case-sensitive variables, specify the flag option $OPTIONS -NO.CASE. Refer to Chapter 13 Other Compatibility Issues in Operational Differences between MultiValue and Caché for further details.
Flag Options
Caché MVBasic supports many flag option values that affect the default behavior of individual statements or functions. These are provided to support porting or emulation of specific functional differences between the various MultiValue implementations.
To turn on (activate) a flag option value, specify the option name ($OPTIONS CASE). To turn off a flag option value, prefix the option name with a minus sign ($OPTIONS -CASE). You can specify multiple flag options, separated by blanks. The emulation option, if present, must be specified as the first option.
The specific flag option values are listed in the $OPTIONS section of Operational Differences between MultiValue and Caché. They are described individually in the reference page for the statement or function for which they modify default behavior.
Command Line Emulation Mode
From the MultiValue Shell, the emulation mode is specified for the current account (namespace) using the CEMU command line command. The initialization value is Cache. However, once CEMU sets an emulation for an account, that emulation is persistent across processes and Caché restart. This is the emulation mode used for the compilation and execution of an MVBasic statement from the command line.
Use the $OPTIONS statement to temporarily override the emulation setting established by CEMU. To specify an option setting other than the ones set by the CEMU emulation mode, it is necessary to specify the $OPTIONS statement and the MVBasic statement that it affects on the same command line.
For example, the default value for SYSTEM(33) is the contents of the command stack. To return the UniData SYSTEM(33) value (the system platform name), it is necessary to specify $OPTIONS UniData on the same command line. This is shown in the following Windows example:
USER:CEMU
Emulation for account 'USER' is 'CACHE'
USER:;PRINT SYSTEM(33)
;PRINT SYSTEM(33)þCEMU
USER:;$OPTIONS UniData ;PRINT SYSTEM(33)
Windows NT
USER:;PRINT SYSTEM(33)
;PRINT SYSTEM(33)þ;$OPTIONS Unidata ;PRINT SYSTEM(33)þ;PRINT SYSTEM(33)þCEMU
The following example sets a custom emulation. It begins in Cache' emulation (SYSTEM(1001)=0). $OPTIONS sets the emulation as PICK (SYSTEM(1001)=5) and also turn off the CASE option (-CASE). This makes local variable names not case sensitive. The result is a PICK emulation without case sensitivity, which is a behavior otherwise only found in D3 emulation.
USER:CEMU
Emulation for account 'USER' is 'CACHE'
USER:;PRINT SYSTEM(1001)
0
USER:;$OPTIONS PICK -CASE ;x=123 ;PRINT SYSTEM(1001) ;PRINT x ;PRINT X
5
123
123
USER:;PRINT SYSTEM(1001)
0
See Also