NET/MASTER Network Control Language (NCL) Reference Manual

LEAVE
Core Statements
106126 Tandem Computers Incorporated 2–35
Example
The following procedure increments the counter &A by 1, if the counter is less than a
random number &B. If the counter is, or becomes, greater than the random number, it
exits the DO group and displays the number of additions carried out:
LEAVE_PROC: PROCEDURE
&A=50
&B=RANDOM(1,100)
LAB1:
DO FOREVER
IF &A > &B THEN
LEAVE
ELSE
&A = &A + 1
END
SAY "NUMBER OF ADDITIONS = " &A - 50
END LEAVE_PROC