| 
                    
 This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com  | 
            ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
                 
                
  | 
                
					
                    
                         
    4D v20.6
 
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
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	4D Language Reference ( 4D v20)
	
	
	4D Language Reference ( 4D v20.1)
	
	
	
	4D Language Reference ( 4D v20.2)
	
	4D Language Reference ( 4D v20.3)
	
	4D Language Reference ( 4D v20.4)
	
	
	4D Language Reference ( 4D v20.5)
	4D Language Reference ( 4D v20.6)
	
	
	
Add a comment