| 4D v13.4On System Event database method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v13.4
 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 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 | 
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