4D v14.3On System Event database method |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
On System Event database method
|
$1 -> On System Event database method | ||||||||
Parameter | Type | Description | ||||||
$1 | Longint |
![]() |
Event code | |||||
The On System Event database method is called each time a system event occurs. This concerns all 4D environments: 4D (all modes) and 4D Server, as well as 4D applications that are compiled and merged with 4D Volume Desktop.
To process an event, you must test the value of the $1 parameter within the method and compare it to one of the following constants, found in the Database Events theme:
Constant | Type | Value | Comment |
On after host database exit | Longint | 4 | The On Exit database method of the host database has just finished running |
On after host database startup | Longint | 2 | The On Startup database method of the host database just finished running |
On application background move | Longint | 1 | The 4D application moves to the background |
On application foreground move | Longint | 2 | The 4D application moves to the foreground |
On before host database exit | Longint | 3 | The host database is closing. The On Exit database method of the host database has not yet been called. The On Exit database method of the host database is not called while the On Host Database Event database method of the component is running |
On before host database startup | Longint | 1 | The host database has just been started. The On Startup database method method of the host database has not yet been called. The On Startup database method of the host database is not called while the On Host Database Event database method of the component is running |
These events are generated when a 4D application changes level, irrespective of the user action initiating this change. For example:
It is absolutely necessary to declare the $1 parameter (longint) in the database method. The structure of the database method code is therefore:
// On System Event database method
C_LONGINT($1)
Case of
:($1=On application background move)
//Do something
:($1=On application foreground move)
//Do something else
End case
Product: 4D
Theme: Database Methods
Created: 4D v13
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)