Top > Lycia reference > Querix 4GL > Statements > DEFER
To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
To prevent a 4GL application from termination while executing, if the Interrupt key or Quit key is pressed, use the DEFER statement.
The DEFER statement can be followed either by the INTERRUPT keyword (to prevent a program from termination on pressing the Interrupt key) or by QUIT keyword (to prevent a program from termination on pressing the Quit key). A program that contains no DEFER statement will be terminated if either of these keys is pressed. By default, the Interrupt key is CONTROL-C and the Quit key is CONTROL-\.
If the source code contains a DEFER statement, either the int_flag or quit_flag built-in variable is set to a non-zero value. The int_flag is set to TRUE, if the DEFER INTERRUPT statement is in effect. The quit_flag is set to TRUE when the DEFER QUIT statement is in effect.
The DEFER statement can appear only within the MAIN block and only once in a program. This statement remains in effect after it has been executed, the default actions for the Quit and Interrupt keys cannot be restored. The code which checks the status of the int_flag and quit_flag variables can be included into a program.
Querix offers an alternative to the DEFER INTERRUPT and DEFER QUIT commands. They now can be handled using the global event handlers. For more details, see the WHENEVER statement section of this document.