THROW Verb
Syntax
THROW str{,int}{,ERR=lineref}
Description
In BBj 6.0 and higher, the THROW verb generates a runtime error with a given error message and a given error number.
Parameter |
Description |
---|---|
str |
The value returned by errmes(-1)after the runtime error has been generated. |
int |
The value returned by err after the runtime error has been generated. It must evaluate to a non-negative integer value in the range [0,1024]. |
ERR=lineref |
In BBj 18.0 and higher, an ERR= may be specified to immediately take the specified branch, as opposed to throwing the error to the error handler in effect. |
Remarks
BASIS reserves the error numbers in the range 0-255. While developers can "throw" these BASIS-reserved error numbers, they should avoid attaching any private meaning to any error number in this reserved range as BBj might generate an error number in this range at some future time.
The error numbers in the range 256-1024 are reserved for developer use. BASIS will not use any numbers in this range so developers can attach whatever meaning they want to the numbers in this range.
THROW will not allow the developer to throw an error number that is above 1024. Attempting to THROW an error number above 1024 will result in !ERR=202 (BBJ_ILLEGAL_USAGE).
Examples
|