version 11 (Modified)
4D manages system variables, which allow you to control the execution of different operations. All system variables are process variables that can only be accessed within one process. This section describes 4D system variables.
OK
This is the most commonly used system variable. Usually it is set to 1 when an operation is successfully executed. It is set to 0 when the operation fails. Many 4D commands modify the value of the OK system variable. Refer to the description of each command to find out whether it affects this system variable.
Document
Document contains the "long name" (access path+name) of the last file opened or created using the following commands:
Append document | BUILD APPLICATION |
Create document | Create resource file |
EXPORT DATA | EXPORT DIF |
EXPORT SYLK | EXPORT TEXT |
IMPORT DATA | IMPORT DIF |
IMPORT SYLK | IMPORT TEXT |
GET DOCUMENT ICON | LOAD SET |
LOAD VARIABLES | Open document |
Open resource file | PRINT LABEL |
QR REPORT | READ PICTURE FILE |
SAVE VARIABLES | SAVE SET |
Select document | SELECT LOG FILE |
SET CHANNEL | USE CHARACTER SET |
WRITE PICTURE FILE |
FldDelimit
FldDelimit contains the character code that will be used as a field separator when importing or exporting text. By default, this value is set to 9, which is the character code for the Tab key. To use a different field separator, assign a new value to FldDelimit.
RecDelimit
RecDelimit contains the character code that will be used as a record separator when importing or exporting text. By default, this value is set to 13, which is the character code for the Carriage Return key. To use a different record separator, assign a new value to RecDelimit.
Error
Error can only be used in a method installed by the ON ERR CALL command. This variable contains the error code. 4D error codes and system error codes are listed in the Error Codes section.
MouseDown, MouseX, MouseY, KeyCode, Modifiers and MouseProc
These system variables can only be used in a method installed by the ON EVENT CALL command.
MouseDown is set to 1 when the mouse button is pushed. Otherwise, it is set to 0.
If the event is a MouseDown (MouseDown=1), the MouseX and MouseY system variables are respectively set to the vertical and horizontal coordinates of the location where the click took place. Both values are expressed in pixels and use the local coordinate system of the window.
Note: When a picture field or variable is clicked, the MouseX and MouseY system variables return the local coordinates of the click in the On Clicked, On Double clicked form events as well as the On Mouse Enter and On Mouse Move form events. For more information, please refer to the Pictures and SVG Find element ID by coordonates sections.
KeyCode is set to the character code of the key that was just pressed. If the key is a function key, KeyCode is set to a special code. Character codes and function key codes are listed in the sections ASCII Codes and Function Key Codes.
Modifiers is set to the keyboard modifier keys (Ctrl/Command, Alt/Option, Shift, Caps Lock). This variable is only significant in an "interruption on event" installed by the command ON EVENT CALL.
MouseProc is set to the process number in which the last event took place.
See Also