Top > Lycia reference > Querix 4GL > Statements > WHENEVER
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.
WHENEVER statement is used to specify an action that is to be performed, when 4GL encounters an error, a warning, an end-of-data condition or other event during the execution of a program.
Element |
Description |
Event |
An exceptional condition which can be trapped using the WHENEVER statement |
Event Handler |
A programmer-defined or built-in 4GL function with no parentheses and no argument list |
Label |
A previously declared label |
WHENEVER statement cannot appear outside a program block, it must occur either in the MAIN, FUNCTION or REPORT program block.
WHENEVER statement must include the identification of an exceptional condition, and the identifier of the way in which 4GL should react to this condition if it occurs during the execution of a program.