TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-133
#DELTA Built-In Function
Conditional constructs can be nested.
Iteration (< and >Commands)
Iterations (groups of #DELTA commands to be performed repeatedly) are delimited by
angle brackets. If there is a value in the X register, #DELTA performs the iteration that
number of times. If there is no value in the X register, #DELTA repeats the iteration
until you explicitly end it from within the loop. Each time #DELTA repeats the iteration,
it decrements a counter; if, however, you use the @ flag before the closing greater-
than sign (@>), the iteration count is not decremented.
You can put a conditional construct containing an end-iteration command (>or @>)
within the iteration: If the condition is true, the end-iteration command forces the loop to
start its next execution before reaching the actual end of the iteration.
You can use the semicolon command (;) within an iteration to force its termination,
based on a test of the value in the X register:
You can nest iterations.
The following iterative statement searches for all occurrences of the British spelling of
the word color (colour), and changes it to the American spelling by deleting the letter
“u.” The : flag before the S command directs the search to return a status value. If the
value is zero, the search failed and the semicolon command ends the iteration:
bj <:Scolour$;-c -d>
; Exit if X register is greater than or equal to zero.
@; Exit if X register is equal to zero.
:; Exit if X register is less than zero.
@:; Exit if X register is not equal to zero.