Top  >  Lycia reference  >  Querix 4GL  >  Functions  >  Help  >  err_get( )

err_get( )

 

ERR_GET() takes an integer expression as its argument and returns a character string containing the text of the 4GL or SQL error message for the specified argument.

 

Description: ERR_GET()%20function

 

Usage

 

ERR_GET( ) is  most useful when you are developing a program. The message that it returns is probably not helpful to the user of your 4GL application. The argument of ERR_GET( ) is typically the value of the status variable, which is affected by both SQL and 4GL errors, or else a member of the global SQLCA.SQLCODE record.

 

In the following example user is prompted to enter an error code and presses "OK".

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

The corresponding error text is displayed in the winmessage error window if found.

 

MAIN

  DEFINE

    current_error_status integer,

    str STRING

  CALL fgl_winprompt(10, 10, "Enter error number:", "-1110",  5, 2) returning current_error_status

  LET str = "Error ", current_error_status

  CALL fgl_winmessage(str clipped, err_get(current_error_status), "error")

END MAIN

 

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.

 

References:

ERR_PRINT( ), ERR_QUIT( ), ERRORLOG( ), fgl_gethelp( ), STARTLOG( )