TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-4
Example of ASSERT Statement
3. During program execution, if an assert-level is equal to or higher than the current
assertion-level and the associated condition is true, the compiler invokes the error-
handling procedure.
4. After you debug the program, you can nullify all or some of the ASSERT
statements by specifying an ASSERTION directive with an
assertion-level that is
higher than the highest
assert-level you want to nullify:
?ASSERTION 11, PROCESS_DEBUG_
!Assertion-level nullifies assert-level 10 and below
For more information, see ASSERTION Directive on page 16-14.
Example of ASSERT Statement
This example invokes PROCESS_DEBUG_ whenever 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
If you change the assertion-level in the ASSERTION directive to 15, you nullify the two
ASSERT statements that specify
assert-level 10 and the $CARRY condition.
If you change the
assertion-level to 30, you nullify all the ASSERT statements. If
ASSERT statements that cover a particular condition all have the same
assert-level, it
is easier to nullify specific levels of ASSERT statements.
Assignment Statement
The assignment statement assigns a value to a previously declared variable.
A bit-deposit assignment statement is a special form of the assignment statement; its
description follows the assignment statement description.
:=
expression
variable
VST1203.vsd