Navigation: ABC Library Reference > ErrorClass > ErrorClass Methods >====== ThrowFile (set value of %File, then process error) ====== | |
ThrowFile( error id, filename ), PROC
ThrowFile | Sets the substitution value of %File, then processes the error. |
error id | An integer constant, variable, EQUATE, or expression that indicates which error to process. |
filename | A string constant, variable, EQUATE, or expression that indicates which file produced the error. |
The ThrowFile method sets the substitution value of %File, then processes the error, and finally returns the severity level of the error.
ThrowFile combines the functionality of SetFile and Throw into a single method.
Implementation:
The ABERROR.INC file contains a list of default symbolic constants for the error id parameter. The value of the ErrorClass.FileName property is substituted for any %File symbols in the error message text.
The ThrowFile method may or may not RETURN to your calling program, depending on the severity of the error.
Return Data Type: BYTE
Example:
OPEN(MyFile)
IF ERRORCODE()
Severity = GlobalErrors.ThrowFile(Msg:OpenFailed, NAME(MyFile))
END