Top > Lycia reference > Querix 4GL > Statements > ERROR
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.
ERROR statement is used to display a message at the line reserved for error messages, it is usually the last line of a 4GL window or the 4GL screen. When the ERROR statement is executed, 4GL rings the terminal bell.
Element |
Description |
Display Value |
A variable, a quoted character string or their combination with coma separators |
ATTRIBUTE Clause |
Optional clause that applies display attributes to the error message displayed |
Display Value can consist of:
a character string enclosed in quotation marks
a variable of CHAR, STRING or VARCHAR data type
You can specify character variables and literal character strings in the error message in any combinations. The variables that follow the ERROR message, if any, will be replaced by their values, all the elements used in the error message will be concatenated. There will be no white spaces between them unless the spaces are explicitly specified.
The total length of an error message is limited to the length of a single line within a window or the 4GL screen where this message is to be displayed. The error message is cleared from the screen when any key is pressed.
You can use the CLIPPED operator to strip off the trailing blanks from variables, the USING operator to specify the format of the display, and SPACE operator to insert blank spaces, e.g.:
ERROR sample_patt CLIPPED, " is not valid."
Error messages appear on the special line called the error line, by default it is the last line of the 4GL screen or window. The default position of the error line can be changed by the closest OPTIONS statement with the ERROR LINE clause. The position of the ERROR line cannot be changed by the ATTRIBUTE clause of the OPEN WINDOW statement.
Related articles:
ATTRIBUTE clause of the ERROR statement has the structure of the general ATTRIBUTE clause. The ATTRIBUTE clause of the ERROR message has some features that are not described in the general description of the ATTRIBUTE clause, they are:
The ERROR statement ignores INVISIBLE attribute, if it is combined with any other attribute
The ERROR statement displays the INVISIBLE attribute as NORMAL if it is the only attribute of an error message (currently it is displayed as invisible – no text)
ERROR "The input data is out of the allowed range"
ATTRIBUTE (RED, UNDERLINED)
System error messages are also displayed on the error line. They usually display information that can be useful in the process of application development. You may want to hide the system error messages from the users. The WHENEVER statement can be used to prevent system error messages from being displayed. With the help of the WHENEVER statement, you can use the ERROR statement which will display a suitable message to replace a system error message.