4D v14.3

System Variables

Home

 
4D v14.3
System Variables

System Variables  


 

 

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.

For more information about the type of these variables, refer to System variables in the Typing Guide.

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.

In this documentation, the pictogram indicates that a command modifies the value of the OK variable. You can click on this picture in order to generate a list of all the commands concerned.

Click here to display a list of commands that modify the OK variable.

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 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.

These variables can only be used in an error-catching method installed by the ON ERR CALL command. If you want for them to be accessible in the method that caused the error, copy their value into your own process variables.

  • Error: Longint type system variable. This variable contains the error code. 4D error codes and system error codes are listed in sections of the Error Codes theme.
  • Error method: Text type system variable. This variable contains the full name of the method that triggered the error.
  • Error line: Longint type system variable. This variable contains the line number at the origin of the error in the method that triggered the error.

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 section and the SVG Find element ID by coordinates command.
  • 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 Unicode Codes, ASCII Codes and SVG Find element ID by coordinates.
  • 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.

 
PROPERTIES 

Product: 4D
Theme: Language definition

 
SEE ALSO 

Sets
Typing Guide
Variables

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : System Variables ( 4D v12.4)