ERROR

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.

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

Display value can consist of:

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 line

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.

ATTRIBUTE clause

ATTRIBUTE clause of the ERROR statement has the structure of the common ATTRIBUTE clause. The ATTRIBUTE clause of the ERROR message has some features:

ERROR "The input data is out of the allowed range" ATTRIBUTE (RED, UNDERLINED)

System error messages

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.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.