ADDERR

Previous  Next

 

errno = ADDERR( error-message AS STRING ) AS INTEGER

 


 

Use this function to add a custom error message.  The resulting error number will be returned and can be used to raise an error condition with the "ERROR errno" statement.  The ERR function can be used to get the current error number together with ERRL and ERRM.

 

Example:

 

DIM errno AS INTEGER

 

ON ERROR GOTO _ERROR

 

' Generate Error #34 (Colon Expected)

ERROR 34

 

' Create a new Error and Generate it

errno = ADDERR( "ERROR, Hello this is a new error" )

ERROR errno

 

END

 

_ERROR:

PRINT "%ERROR, ";ERRM; " [";ERR;"] at Line ";ERRL,

RESUME NEXT