General information
Category:
Coding, syntax & commands
Hi,
This is what I use. To be honest I have been meaning to improve the error handling in this product for ages but never get the time.
PROCEDURE Soluserror
PARAMETERS p_ERROR, p_MESSAGE, p_MESSAGE1, p_PROGRAM, p_LINENO
LOCAL lcerror,w_msg1,w_msg2
=AERROR(w_aerror)
lcerror = iWord(ON("ERROR"), 2)
*DO &lcerror WITH nError, w_aerror[1,2], "", cMethod, nLine
w_msg1 = "An error has occurred. Please report the following error to Infosupport. " + CHR(13)
w_msg2 = "Error " + LTRIM(STR(ERROR())) + CHR(13)+ ;
"Message() " + MESSAGE() + CHR(13) + ;
"Message(1) " + MESSAGE(1) + CHR(13) + ;
"SYS(2018) " + SYS(2018) + CHR(13) + ;
"Program " + ALLTRIM(UPPER(p_program)) + CHR(13) + ;
"Line Number " + ALLTRIM(STR(p_lineno))
IF MESSAGEBOX(w_msg1+w_msg2,21,"Application Error" ) = 2
* cancel pressed quit
QUIT
ENDIF
IF x_fpwrun()
SUSPEND
ENDIF
RETURN
*
*
*
HTH
Jon
>Hi Jon
>
>I noticed an error procedure in you startup code :
>ON ERROR DO soluserror WITH ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
>
>Is it possible to get your error procedure please. My startup has no error trapping facilities at all.
>Thanks
>Shafid
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only