Skip to main content
How Can We Help?
< All Topics
Print

System Variables

The software maintains a series of system variables that represent either fixed values ($ZimOS) or values that fluctuate dynamically with the current status of the software ($InTransaction) or of application objects (ThisWindow.WindowTag).

System variables resemble global variables in nature. The software automatically sets or resets the values of system variables to reflect the status of the software and the current application. In some cases, an application program can also reset them.

A system variable name can be used as an atomic expression denoting the value currently held in the memory location associated with the variable. A system variable name can be used almost anywhere that a literal can be used.

Available System Variables

System variables are categorized into those that supply information about windows, those that supply information about menus, those that supply information about forms, and those that supply general information. Some system variables are “binary” in nature in that they evaluate only to ‘1’ ($True) or ‘0’ ($False), while others may be set to a variety of values.

General-use System Variables with “Permanent” Values

Given a particular version of the software, the following system variables have the same value at all times during an application session:

$ClipPathPath to the disk directory to be used for Cut, Copy, and Paste operations that involve user interface objects in the Screen Painter.
$DBCharSetIndicates the character set used by the application database.
$DBPathPath to the disk directory in which the application database is stored.
$FalseA “binary” false value for comparison.
$ImagePathPath to the disk directory containing image files for use in forms.
$NullA “null” value for comparison.
$TimeSecsThe elapsed number of seconds since 12:00am, 1 January 1970.
$TrueA “binary” true value for comparison.
$WorkPathPath to the disk directory where the application users’ work fields can be found (specified in a Zim configuration file).
$ZimOSIdentifies the operating system in use.
$ZimPathPath to the disk directory in which the Zim software is installed.
$ZimProductIdentifies the Zim product currently being used.
$ZimVersionIdentifies the Zim version currently being used.

General-use System Variables with Values Derived from the Operating System

The software sets the values of the following system variables based on current values obtained from the operating system:

$DateThe current date.
$GroupIDThe current user’s operating system group identifier.
$TimeThe current time.
$UserIDThe current user’s operating system user identifier.

System Variables Periodically Set/Reset by the Software or the Application System

The values of these variables are set and reset depending on conditions encountered during execution of the application. An application program can assign a value to any of these variables at any time; however, the assigned value can be overwritten as conditions subsequently change during the application session.

Last Callback Event

Event is a data structure that provides information about the application environment the time of the most recent callback even. Each variable in the structure provides one item of information. The values of these variables are reset each time a callback event returns control to the application program. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that a callback event occurs.

Event.AltKey,
Event.CtrlKey,
Event.ShiftKey
The state of the Alt, Ctrl, and Shift keys during the last event.
Event.EventNameThe last event to occur.
Event.EventTagThe object in which the last event occurred.
Event.EventTypeThe type of event that last occurred.
Event.FieldTagThe current field at the time of the last event.
Event.FormTagThe current form at the time of the last event.
Event.KeyPressedThe key that, when pressed, caused the last event to occur.
Event.MenuItemTagThe selected item on the menu in the current window at the time of the last event.
Event.MenuTagThe current menu at the time of the last event.
Event.MouseClickIf a mouse button accelerator caused an event to occur.
Event.ScrollingKeyIf an event corresponds to a defined SCROLL key.
Event.WindowTagThe current window at the time of the last event.

Text Cursor Positioning

$CursorCol, $CursorRowThe location of focus in a window when an event occurs.
$CursorScreenCol, $CursorScreenRowThe location of focus on the screen when an event occurs.
$DirectionThe direction in which focus was moving when an event occurs.

Error Status

$ErrCodeThe error code generated by the last command executed.
$ErrLevelThe error severity level generated by the last command executed.
$LastErrCodeThe error code generated by the last command that returned an error code.
$LastErrLevelThe error severity level generated by the last command that returned an error severity level.

 

$LastErrMessageThe error message generated by the last command that returned an error code.
$MaxErrLevelThe highest error severity level generated during the application session.
$SQLErrCodeThe error code returned from the SQL database.
$SQLErrMsgThe error message returned from the SQL database.

Other Status Conditions

$BreakFlagIf the application user has pressed the “break” key.
$DeadlockReasonThe reason that a deadlock condition occurred.
$InTransactionIf an explicit transaction is in progress.
$LocatedThe number of records located by a LOCATE command.
$MemberCountThe number of records processed by a set-processing command.
$PageThe current page number in a report.
$SetCountThe number of records found by the last FIND command.

External Programs

$EditorThe name of a text editor software package.
$GraphicsThe name of a graphics software package.
$HelpFileThe name of a disk file containing online help.

Security

$ZGroupIDThe application user’s Zim group identifier.
$ZUserIDThe application user’s Zim user identifier.

System Variables Concerned with Windows

Last Event in the Current Window

ThisWindow is a data structure that provides information about the state of the application environment and of the current window at the time of the last event in that window. Each variable in the structure provides one item of information. The values of these variables are reset each time a window becomes the current window. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that another window becomes the current window.

ThisWindow.AltKey,
ThisWindow.CtrlKey,
ThisWindow.ShiftKey
The state of the Alt, Ctrl, and Shift keys at the time of the last event in the current window.
ThisWindow.EventNameThe last event that occurred in the current window.
ThisWindow.EventTagThe identification tag of the object in which the last event in the current window occurred.
ThisWindow.EventTypeThe type of event that last occurred in the current window.
ThisWindow.KeyPressedThe key that, when pressed, caused the event that last occurred in the current window.
ThisWindow.MouseClickIf a mouse button accelerator caused the event that last occurred in the current window.
ThisWindow.ScrollingKeyIf the accelerator that caused the event that last occurred was also a defined SCROLL key.
ThisWindow.WindowCol,
ThisWindow.WindowRow
The character column and character row position of the current window.
ThisWindow.WindowHeight,
ThisWindow.WindowWidth
The physical size of the current window in character rows and columns.

ThisWindow.WindowName,
ThisWindow.WindowNum,
ThisWindow.WindowTag

The current window
ThisWindow.WindowStateIf the current window is maximized, minimized, or otherwise.

Miscellaneous

$WindowPSHeight, WindowPSWidthThe logical size of the current window in character rows and columns.

System Variables Concerned with Menus

Last Event in the Current Menu

ThisMenu is a data structure that provides information about the state of the software environment and of the current menu at the time of the last event in that menu. Each variable in the structure provides one item of information. The values of these variables are reset each time that FORM or MENU INPUT terminates. An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that FORM or MENU INPUT terminates.

ThisMenu.MenuchangedIf any menu item in the current menu has been modified by the application use at the time of the last event in the current window.
ThisMenu.MenuItemNum,
ThisMenu.MenuItemTag
The selected item on the menu at the time of the last event in the current window.
ThisMenu.MenuNum
ThisMenu.MenuTag
The current menu at the time of the last event in the current window.

System Variables Concerned with Forms

Last Event in the Current Form/Display

ThisForm is a data structure that provides information about the state of the current form/display at the time of the last event in the current window. Each variable in the structure provides one item of information. The values of these variables are reset each time that FROM or MENU INPUT terminates, An application program can assign a value to any of these variables at any time; however, the assigned value is overwritten the next time that FORM or MENU INPUT terminates.

ThisForm.DisplayTagThe display that had focus at the time of the last event in the current window.
ThisForm.FieldChangedA code indicated if the form field that had focus at the time of the last event in the current window was modified by the application user.
ThisForm.FFFieldNum,
ThisForm.FieldTag
The form field that had focus at the time of the last event in the current window.
ThisForm.FormChangedA code indicating if any form field in the form or display had been modified by the application user at the time of the last event in the current window.
ThisForm.FormNum,
ThisForm.FormTag
The form that had focus at the time of the last event in the current window.
ThisForm.ReqError,
ThisForm.ReqFieldNum,
ThisForm.ReqFormNum,
ThisForm.ReqSubscript,
ThisForm.ReqTag
If all required form fields had values at the time of the last event in the current window.
ThisForm.SubscriptThe instance of the form where focus was located at the time of the last event in the current window.
ThisForm.ValError,
ThisForm.ValFieldNum,
ThisForm.ValFormNum.
ThisForm.ValSubscript,
ThisForm.ValTag
If all form fields contained valid values at the time of the last event in the current window.

</td>

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese