TAL Programmer's Guide
ASSERT Statement
Controlling Program Flow
12–18 096254 Tandem Computers Incorporated
The following example activates PROCESS_DEBUG_ when an out-of-range condition
occurs:
?SOURCE $SYSTEM.SYSTEM.EXTDECS (PROCESS_DEBUG_)
?ASSERTION 5, PROCESS_DEBUG_
!Assertion-level 5 activates all ASSERT conditions
SCAN array WHILE " " -> @pointer;
ASSERT 10 : $CARRY;
!Lots of code
ASSERT 10 : $CARRY;
!More code
ASSERT 20 : $OVERFLOW;
!$OVERFLOW function tests for arithmetic overflow
Nullifying ASSERT
Statements
To make it easier to nullify all ASSERT statements that cover a particular condition, set
all such ASSERT statements to the same assert-level. In the previous example, if you
specify an ASSERTION directive with an assertion-level of 11, you nullify the two
ASSERT statements that are set at 10. If you specify an ASSERTION directive set to
30, you nullify all the ASSERT statements.