err_print()

err_print() takes an integer expression as its argument and displays on the Error line the text of an SQL or 4GL error message, corresponding to a negative integer argument.

Description: ERR_PRINT()%20function

The argument of err_print() specifies an error message number, which must be less than zero. It is typically the value of the global status variable, which is affected by both SQL and 4GL errors. For SQL errors only, you can examine the global SQLCA.SQLCODE record.

err_print() is most useful when you are developing a 4GL program. The message that it returns is probably not helpful to the user of your application.

 

In this example user enters an error code and presses ACCEPT.

The default error code value in the example is -1110.

The corresponding error text is displayed in the error line of the window.

 

The value of status can be assigned by a wide range of different statement variables.  In order to avoid the status being changed unexpectedly it is always advisable to copy it as soon as possible so that the value you want to maintain does not get changed.

If you specify the WHENEVER ANY ERROR CONTINUE compiler directive (or equivalently, the anyerr command-line flag), status is reset after certain additional 4GL statements.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.