Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement