# CHAPTER 2: System Variables

## 2.1 Introduction

There are several Empress system variables which allow the user to control the Empress 4GL environment. They all have default values, which are defined in the file `initfile` in the Empress `custom` directory. These variables can be reset in the operating system before starting the Empress 4GL environment. Examples for each operating system are below.

UNIX C shell:

       setenv VARIABLE value

UNIX Bourne shell:

       VARIABLE=value; export VARIABLE

If value contains special characters or spaces, it must be quoted,i.e.: `"some value"`.
Table 2-1

System Variable Function
`MS4GLCHKNULVAL` | If set to any value, null values for `NOT NULL` attributes will be detected by the check command.
`MS4GLCOMPATCHK` | If set to any value, allows warning messages regarding possible compatibility problems to be issued when an application is compiled.
`MS4GLDEBUGSETUP` | Specifies the pathname of the file containing the initialization information for Empress 4GL debugging.
`MS4GLFLUSHTYPEAHEAD` | If set to any value, typeahead will be disabled.
`MS4GLFONTNAME` | Specifies the name of the font to use for workstation display managers.
`MS4GLFONTNAME2` | Fontname specification for the Korean implementation of Empress.
`MS4GLKANJICONVERTER` | Specific to the Empress Kanji version.
`MS4GLNOLOADRUNMSG` | If set to any value, loading and running informational messages will be suppressed.
`MS4GLPRINTSCREEN` | Specifies the pathname of the file in which to store screen dumps.
`MS4GLPRINTSCREENFORMAT` | Specifies which output format to use when printing a screen.
`MS4GLPSHEADER` | Specifies the pathname of the header file for PostScript output.
`MS4GLPSHEIGHT` | Specifies the font height for PostScript output.
`MS4GLPSWIDTH` | Specifies the font width for PostScript output.
`MS4GLAPFMDB` | Specifies the pathname of the Empress 4GL system database.
`MSTERM` | Specifies the name of the terminal in use.
`MSTERMDB` | Specifies the pathname of the terminal information database.
`MS4GLXASYNCOFF` | If set to any value, this variable disables immediate processing of the <Interrupt> key when the 4GL application is running X Windows.
`MS4GLXCOLORTOLERANCE` | When running under X Windows, if Empress 4GL is unable to obtain a color, this variable specifies how much difference - between the request color and an obtainable one - Empress 4GL will tolerate.
`MS4GLXCURSORCOLOR` | Specifies the foreground and background colors of the cursor of a 4GL application running under X Windows.
`MS4GLXNEWCOLORMAP` | If set to any value, this variable enables instructs Empress 4GL to use a new colormap under X Windows.
`MS4GLXPOINTERCOLOR` | This variable defines the pointer color under X Windows.
`MS4GLXWINDOWTITLE` | Specifies the title for the Empress 4GL window under X Windows.

## 2.2 Description of System Variables

`MS4GLCHKNULVAL`

By default, the Empress 4GL command `"check expr for attr"` will always accept a null value, even if the attribute is defined as `NOT NULL`. To detect null values for `NOT NULL` attributes, set the variable to any value.

`MS4GLCOMPATCHK`

If this variable is set to any value, Empress 4GL checks for possible compatibility problems when an application is compiled, issuing warning messages where appropriate. One possible problem is due to the fact that Version 4 does not handle null values the same way Version 2 does.

`MS4GLDEBUGSETUP`

This specifies the path to the file which stores setup information for the Empress 4GL Debugger. Change it if you change the name or location of this file.

`MS4GLFLUSHTYPEAHEAD`

This variable affects the behavior of Empress 4GL. Keyboard input which is typed faster than Empress 4GL can respond is saved. The commands are held temporarily and passed to Empress 4GL when it is ready. This is known as "typeahead". It may be disabled by setting this variable to any value.

`MS4GLFONTNAME`

When using workstation display managers, `MS4GLFONTNAME` names the font to be used by Empress 4GL. An example for X Windows is "8x13".

`MS4LGFONTNAME2`

This variable specifies the name of the font to use for Hangul characters when using the Korean version under X Windows. This is different from the font used for English characters (default value is `r16`). If this variable is not set or set to a null string, the default value is `hangul16`.

`MS4GLKANJICONVERTER`

For the Japanese (Kanji) version of Empress 4GL running under X Windows, this variable specifies the type of Kanji converter for your machine such as `kinput`, `sj3` or `xim`. The default setting is `kinput`.

`MS4GLNOLOADRUNMSG`

Empress 4GL will display informational messages when an application is called. If `MS4GLNOLOADRUNMSG` is set to any value, these messages will be suppressed.

`MS4GLPRINTSCREEN`

When the <Print Screen> key is pressed, the screen dump is appended to the file specified by this variable. Note that the <Print Screen> key is defined in `termdb.term_ap_key` and the Help screen display.

`MS4GLPRINTSCREENFORMAT`

When printing a screen to a file, `MS4GLPRINTSCREENFORMAT` specifies the format of the output. It may be set to either `a` or `p` to produce ASCII or PostScript, respectively. The best setting for your system depends on the type of printer being used. ASCII is an easily-transportable industry standard, while PostScript allows more sophisticated layouts on many laser printers.

`MS4GLPSHEADER`

Whenever a screen is dumped in PostScript format, the file specified by `MS4GLPSHEADER` will have its contents included before the screen dump. It needs to be set only if you have selected PostScript output (using `MS4GLPRINTSCREENFORMAT`) and only if such a file exists.

`MS4GLPSHEIGHT`

`MS4GLPSHEIGHT` specifies the height of the bounding box to be used for PostScript output from the Empress 4GL print screen command. It needs to be set only if you have selected PostScript output (using `MS4GLPRINTSCREENFORMAT`). Note that a bounding box is the total space occupied by a character and the white space around it.

`MS4GLPSWIDTH`

`MS4GLPSWIDTH` specifies the width of the bounding box to be used for PostScript output from the Empress 4GL print screen command. It needs to be set only if you have selected PostScript output (using `MS4GLPRINTSCREENFORMAT`). Note that a bounding box is the total space occupied by a character and the white space around it.

`MS4GLAPFMDB`

If an alternative to the system database supplied with Empress is desired, `MS4GLAPFMDB` can be used to specify the pathname of a different system database to be used by Empress 4GL. It should be set in the operating system.

`MSTERM`

`MSTERM` identifies the type of terminal in use. Set it whenever you change the type of terminal you are using. While `TERM` is used if `MSTERM` is not set, we recommend that you set `MSTERM` separately since `TERM` is shared with other software and there is some risk of conflict. Note that `MSTERM` is not needed for SQL, which makes less rigorous use of the terminal.

`MSTERMDB`

If you wish to use an alternate terminal database, `MSTERMDB` should be set to the pathname of the new terminal information database. `MSTERMDB` is used only by Empress 4GL. It is not needed for SQL, which makes less rigorous use of the terminal.

`MS4GLXASYNCOFF`

When this variable is unset, the <Interrupt> key will be processed immediately when pressed. If `MS4GLXASYNCOFF` is set, the <Interrupt> key will be processed after any pending X events.

`MS4GLXCOLORTOLERANCE`

On X Windows servers which have few colors available, Empress 4GL may not be able to allocate a color it wants. If `MS4GLXCOLORTOLERANCE` is set, Empress 4GL will first search the colormap for a color which is "close" to the desired color. Closeness is calculated in the following manner:

`r1`, `g1` and `b1` are the components of the desired color
`r2`, `g2` and `b2` are the components of the current colormap entry
deviation = `(|r1-r2|)2 + (|g1-g2|)2 + (|b1-b2|)2`
If deviation <= `MS4GLXCOLORTOLERANCE`, the current colormap entry is accepted.

If a close color is not found, Empress 4GL will attempt to allocate a new color. If this fails, Empress 4GL will exit; printing an appropriate error message.

`MS4GLXCURSORCOLOR`

This variable changes the color of the text cursor in an Empress 4GL application. If alternate cursor colors are desired, `MS4GLXCURSORCOLOR` should be set to a four-digit decimal integer. The first two digits specify the foreground color; the last two digits specify the background color.

`MS4GLXNEWCOLORMAP`

When this variable is unset, Empress 4GL will attempt to use the existing colormap, either using existing entries or allocating new ones. If `MS4GLXNEWCOLORMAP` is set to any value, Empress 4GL will use its own colormap.

`MS4GLXPOINTERCOLOR`

This variable changes the color of the X Windows pointer when it enters the Empress 4GL window. If alternate pointer colors are desired, `MS4GLXPOINTERCOLOR` should be set to a four-digit integer. The first two digits specify the foreground color; the last two digits specify the background color.

`MS4GLXWINDOWTITLE`

If an alternate window title is desired, set `MS4GLXWINDOWTITLE` to the string you wish to use for the window title.