Appendix C: Macros — Error Handling
1293
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
ER_throw
Declaration: ER_throw
(int
errorCode
)
Category(ies):
Error Handling
Description:
This macro throws an exception to be caught in the ONERR or FINALLY
section of an enclosing TRY block. See chapter
9. Error Handling
for a
complete discussion of throwing and catching exceptions.
Note:
This is a macro version of
ER_throwVar
, but
errorCode
must be an integer
constant.
ER_throw
compiles to shorter code than
ER_throwVar
— about two bytes
shorter per call.
Inputs:
errorCode
— Error number signifying cause of exception.
Outputs:
None. This macro never returns — execution resumes at the ONERR or
FINALLY section of the enclosing TRY block.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: ER_throwFrame, ER_throwVar, FINALLY, ONERR, TRY
Example:
TRY
HANDLE h;
h = HeapAlloc(A_BIG_BUFFER);
if (h == H_NULL)
ER_throw(ER_MEMORY);
.
.
.
HeapFree(h)
ONERR
/* Do something about low memory condition */
.
.
.
ENDTRY