$OPTIONS RUN
Form 1 of $OPTIONS RUN is used to allow KCML programs to modify the value of the $OPTIONS RUN system variable which is an array of bit flags and constants that control the runtime behaviour of KCML. It extends the $OPTIONS variable which is supported for compatibility with other language variants. There is a similar $OPTIONS LIST variable to control how programs are recreated in the KCML Workbench.
Form 2 allows the contents of $OPTIONS RUN to be examined.
Any byte of this variable can be preset at the time KCML starts up by use of the OPTIONS_RUN_XX environment variable.
For example:
It important that $OPTIONS RUN is modified directly in this way as the number of bytes in $OPTIONS RUN may be increased in a future version.
Note that many of the bytes in $OPTIONS RUN are Booleans and therefore can be set any value, i.e. HEX(01), to select the option. However the use of HEX(01) as the value for TRUE is recommended as protection against the definition being extended in the future. Setting the byte to HEX(00) reverts back to the default FALSE setting.
Any of the bytes in $OPTIONS RUN can be preset by defining the environment variable OPTIONS_RUN_xx (where xx is the decimal byte number) in the connection manager before KCML is started and setting it to the two HEX digits required.
Byte(s) | KCML_OPTIONS_RUN field | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | A Boolean parameter used to set the COMPAT30 flag. | |||||||||||||||||||
2 | A Boolean parameter used to set the UNIXPROGS flag. | |||||||||||||||||||
3 | Reserved | |||||||||||||||||||
4 | A Boolean parameter used to set the TOMFILE flag. | |||||||||||||||||||
5 | A Boolean parameter used to set the TOMDIR flag. | |||||||||||||||||||
6 | OPTIONS_RUN_NoEndDoError | A Boolean parameter used to set the NOENDDOERROR flag. | ||||||||||||||||||
7 | A Boolean parameter used to set the DOSELECT flag. | |||||||||||||||||||
8 | A Boolean parameter used to set the BREAK30 flag. | |||||||||||||||||||
9 | Reserved | |||||||||||||||||||
10 | Reserved | |||||||||||||||||||
11 | OPTIONS_RUN_KeepShared | A Boolean parameter used to set the KEEPSHARED flag. | ||||||||||||||||||
12-13 | Reserved | |||||||||||||||||||
14 | If set to HEX(01), KCML removes files before a RESAVE is performed. The implication is that any links are broken and the file is ownership, permissions and date-stamp are set for the current user. | |||||||||||||||||||
15 | Reserved | |||||||||||||||||||
16 | A Boolean parameter used to set the COMPAT32 flag. | |||||||||||||||||||
17 | Sets the keys used to change between the Edit/Debug window and the Console Window. Setting this byte to HEX(FF) will disable the full screen editor/debugger. The default value is HEX(7E) for the TAB key. | |||||||||||||||||||
18-19 | Used to set the programming mode password. A value of zero means that programming mode passwords are not in use. | |||||||||||||||||||
20 | OPTIONS_RUN_Language | Used to select the language when multi-language (multilingual) strings are being used. To make KCML software more interoperable the standard KCML language codes are the recommended settings for this variable. To be noted, BYTE20 is not used to define the encoding code page for $PACK and $UNPACK. For those purposes, please refer to byte 61 here. | ||||||||||||||||||
21-22 | Reserved | |||||||||||||||||||
23 | OPTIONS_RUN_HelpStart$ | Defines the character used to start a $HELP special sequence. By default this byte is set to a ‘{‘. | ||||||||||||||||||
24 | OPTIONS_RUN_HelpStop$ | Defines the character used to end a $HELP special sequence. By default this byte is set to a ‘}’. | ||||||||||||||||||
25-26 | OPTIONS_RUN_MaxPart | Stores the value of the highest available partition number, taken from the BCDPART environment variable. This value was used when KCML started up and is copied here for information only. Directly modifying these bytes will have no effect on partition numbers allocated to subsequent KCML processes | ||||||||||||||||||
27 | Soft return character, HEX(83) by default, used when loading ASCII source in order to preserve Niakwa style line terminators in ‘;’ comments. Can be set to HEX(00) to suppress this function. | |||||||||||||||||||
28 | Replacement character for the ‘@’ sign at the beginning of variables when compiling ASCII source when importing from environments where the ‘@’ prefix does not denote a global variable. The default character is the ‘@’ sign for no replacement. If set to HEX(00) the value of the environment variable ATREPLACE will be substituted if it exists. | |||||||||||||||||||
29 | OPTIONS_RUN_EditorHistory | Changes the maximum number of statements that can be held in the immediate mode command history buffer of the line editor. Defaults to 16. | ||||||||||||||||||
30 | Changes the maximum number of program lines that can be held in the program line modification history buffer of the line editor. Defaults to 16. | |||||||||||||||||||
31 | Changes the maximum number of items held in the immediate mode cut/paste history buffer of the line editor. Defaults to 16. | |||||||||||||||||||
32 | A Boolean parameter used to set the HANGUP flag. | |||||||||||||||||||
33 | Setting this byte to HEX(01) enables Niakwa compatibility mode at runtime. This byte is automatically set if KCML is started with the -n command line parameter. It disables the special treatment of global variables with an '@'; prefix, forces 24 lines for INPUT SCREEN on terminals with more than 24 lines and disables scrolling in PRINT AT(. | |||||||||||||||||||
34 | Modified mouse behaviour. Setting this byte to HEX(01) instructs KCML to use Niakwa style mouse drags. This byte is automatically set if KCML is started with the -n flag. Normally KEYIN does not process any mouse operations but passes them straight through. All mouse drags (unless this byte is set) are returned as drag North. | |||||||||||||||||||
35 | OPTIONS_RUN_Win32Mode |
Changes the way that KCML handles execution of Windows routines defined by the $DECLARE statement and called with the GOSUB' statement. This byte uses a bit pattern mechanism to set the various options. The valid bits are as follows:
| ||||||||||||||||||
36 | OPTIONS_RUN_DisableProg | If set to HEX(01) all programming functionality is disabled. If a STOP or END statement is executed or if the program errors then KCML will automatically execute a PANIC statement. To reinstate programming set it to "P". | ||||||||||||||||||
37 | OPTIONS_RUN_ShellMode |
Used to determine how SHELL is executed.
| ||||||||||||||||||
38 | A Boolean parameter used to set the COMPAT40 flag. | |||||||||||||||||||
39 | In versions of KCML > 04.00 any modifications to environment variables performed with the ENV( function are exported to any child processes. Setting this byte to HEX(00) disables this action and therefore reverts back to the non-exporting method used by older versions of KCML. | |||||||||||||||||||
40 | OPTIONS_RUN_SaveOptions |
Options that control $COMPILE and, in some circumstances, SAVE and LOAD. This byte uses a bit pattern mechanism to set the various options which can therefore be combined.
| ||||||||||||||||||
41 | OPTIONS_RUN_HelpOptions |
$HELP options. This byte uses a bit pattern mechanism to set the various options, the valid bits are as follows:
|
||||||||||||||||||
42 | Size in MB of the memory buffer used by FSORT and KI_REBUILD. Defaults to 4 NT systems. On Unix systems it defaults to 8 for 32bit file access systems and 64 for 64bit systems. | |||||||||||||||||||
43 | Reserved | |||||||||||||||||||
44 | Maximum number of lines used to LIST DIM a variable in a PANIC listing. | |||||||||||||||||||
45 |
SELECT @PART " " options
| |||||||||||||||||||
46 | OPTIONS_RUN_LoadOptions |
Options for LOADing and SAVEing programs. Does not affect $COMPILE.
| ||||||||||||||||||
47 | OPTIONS_RUN_PRINTUSINGMode |
PRINTUSING and PRINTUSING TO options
| ||||||||||||||||||
48 | OPTIONS_RUN_Century | Start of current century. Defaults to 32 so years 0 to 31 will be assumed to be 2000 to 2031. Year 32 will be considered as 1932. | ||||||||||||||||||
49 | OPTIONS_RUN_GlobalFLDs |
Global field variable options
| ||||||||||||||||||
50 | OPTIONS_RUN_LangTable |
Language table for $UPPER, $LOWER and $STRCOLL on non-Unicode systems where USING_UTF8 is not set
HEX(00) US ASCII 7 bit code page (default) HEX(01) ISO Latin-1 code page HEX(02) User defined code page If HEX(00) then HEXPRINT+ will use '.' for the character representation of all characters above HEX(7F) as well as those below HEX(20). Otherwise it will assume that characters above HEX(7F) are printable. | ||||||||||||||||||
51 |
$REWIND/$CLOSE options. The default setting is HEX(03). HEX(01) implied $REWIND in $CLOSE HEX(02) explicit $REWIND | |||||||||||||||||||
52 | OPTIONS_RUN_LogThreshold |
WRITE LOG threshold. HEX(00) report all messages, eg _LOG_INFORMATION, _LOG_WARNING & _LOG_ERROR. HEX(01) report messages of level 1 or higher, eg _LOG_WARNING & _LOG_ERROR. HEX(02) report messages of level 2 only, eg _LOG_ERROR. The default value is HEX(00) to allow all messages. See WRITE LOG for more information. | ||||||||||||||||||
53 | OPTIONS_RUN_PanicEndOptions |
Controls the actions of statements such as $END, PANIC and CATCH in a running interactive program if programming is enabled, HALT is enabled and the programmer has previously invoked the debugger. It is a bit mask field with bits set controlling different statements thus: HEX(01) set then $END will drop into the editor instead of terminating the session. HEX(02) set then a PANIC will be treated as a special A08.41 error and no file will be produced. PANIC can still be typed in immediate mode in the console window to generate a file after the error. HEX(04) set then an error inside a TRY block which would be caught and handled by an outer CATCH clause in another subroutine will still error but continue will be allowed and will resume execution in the CATCH block. This allows the programmer to see why control has transferred to another subroutine. HEX(08) is like HEX(02) except that the special error will be produced even if the workbench has not been previously entered in that session. The default value is HEX(07). | ||||||||||||||||||
54 | If set to >=1 then SAVE ASCII, or SAVE operating in ascii mode (see byte 40 above), will create backup files with a .bak extension. If the value is greater than one a sequence of n backup files will be created. The oldest backup file in the sequence of files will be overwritten on each save. The default is HEX(00) in which no backup is created. | |||||||||||||||||||
55-56 | Stores the value of the minimum available terminal and partition number, taken from the BCDPART environment variable. This value was used when KCML started up and is copied here for information only. Directly modifying these bytes will have no effect on terminal and partition numbers allocated to subsequent KCML processes | |||||||||||||||||||
57 | Reserved | |||||||||||||||||||
58 | Controls the formatting of LIST RETURN. Setting the HEX(01) bit will list programs loaded without the platter or directory to be consistent with KCML 5.02 and before. Unsetting it (the default) display the full absolute path name. | |||||||||||||||||||
59 | OPTIONS_RUN_Constants | This byte controls the use of symbolic constants which are numeric symbols with a leading underscore e.g. _BUFSIZE. If this byte is HEX(00) then they are treated as regular variables for compatibility with previous versions of KCML (constants were introduced in KCML 6.0). If the HEX(01) bit is set then KCML will parse such tokens as constants as disallow any statement other than DIM or COM which attempts to set the value. See Constants in KCML programs. Starting with KCML 6.10 constants are enabled by default. Prior to this it was disabled by default. | ||||||||||||||||||
60 | This byte controls the code page used by the client to interpret the text on forms. On most systems the default value (0 meaning to use the default code page) will do because the default code page on the client's system will support the same language as the text on the forms. Where the default code page is different to the language the wrong characters will be displayed. This is only likely to occur on a small number of test systems using a different code page to the language. (Most of Western Europe uses Latin1, much of Eastern Europe uses Latin2 and there various DBCS character sets for individual languages in the Far East.) You may need to set this byte if you need to display Latin2 characters on a US system for instance. Clearly the client must also have suitable fonts installed. If non-zero the byte must be set one of the standardized language codes as used by $OPTION RUN byte 20. Note that these exact codes must be used even if you are using a non-standard numbering for the strings in chevrons. | |||||||||||||||||||
61 | OPTIONS_RUN_Locale | This byte controls the encoding used by the extended form of $PACK and $UNPACK to convert to and from UTF-8 and UTF-16. This has a default value of 0 meaning the current server locale (usually the C locale for Unix). However if the USING_UTF8 environment variable is set then it is defaulted to HEX(FF), meaning data is encoded in UTF-8 so no translation in and out of UTF-8 is needed. If non-zero the byte must be set to one of the required language code as used in byte 20 here for chevron strings. Note that these exact codes from the table must be used even if you are using a non-standard numbering for the strings in chevrons. If no codepage is defined, it will be set to EN_GB by default. For invalid character conversion, an error message will pop up mentioning the converted character is not in the defined codepage character set range. | ||||||||||||||||||
62 | OPTIONS_RUN_Compatibility |
This byte controls the reporting of some errors for backward compatibility. These errors trap programming conditions that are wrong, but would have silently failed in previous versions of KCML. Because they are known to introduce run-time errors in applications that previously worked, these errors are by default disabled. They may be enabled using this byte, and developers are encouraged to do so. Currently three bits are defined:
|
||||||||||||||||||
63 | Reserved | |||||||||||||||||||
64 |
Modifies form of SAVE ASCII files
| |||||||||||||||||||
65 | OPTIONS_RUN_Compatibility2 |
This byte controls the reporting of some errors for backward compatibility. These errors trap programming conditions that are wrong, but would have silently failed in previous versions of KCML. Because they are known to introduce run-time errors in applications that previously worked, these errors are by default disabled, unless indicated otherwise. They may be enabled using this byte, and developers are encouraged to do so. Currently four bits are defined:
|
||||||||||||||||||
66 | OPTIONS_RUN_LoadOptions_NewAscii |
This BYTE combined with BYTE 46 controls how programs are loaded.
|
||||||||||||||||||
67 | OPTIONS_RUN_Disable_CanConvert | Setting this BYTE to HEX(01) will prevent any CanConvert properties being passed to KClient. This means that any NUM(prec, scale) fields will display according to type without reference to locale settings for Currency on the client machine. | ||||||||||||||||||
68 | OPTIONS_RUN_Asserts | Bitmask controlling the behaviour of ASSERT statements at runtime. Two bits are defined, plus a zero constant for convenience:
|
||||||||||||||||||
69 | OPTIONS_RUN_DollarIf | Controls the behaviour of $IF statements at runtime. Three levels are defined:
|
||||||||||||||||||
70 | OPTIONS_RUN_DeleteNonEmptyPoolHook | Controls the behaviour of the DeleteNonEmptyPool hook. Two bits are defined.
|
||||||||||||||||||
71 | OPTIONS_RUN_PromoteLocalDimStruct | If TRUE, LOCAL DIMmed strings that are single instances of DEF STRUCTs will be backed by NEW PTR. |
$OPTIONS RUN as a record
KCML defines a KCML_OPTIONS_RUN built in DEFRECORD that can be used to access the fields in $OPTIONS_RUN e.g.
klang = FLD($OPTIONS RUN.OPTIONS_RUN_Language)
See also: