TAL Reference Manual
Statements
TAL Reference Manual—526371-001
12-41
Examples of WHILE Statements
Examples of WHILE Statements
1. This WHILE loop continues while ITEM is less than LEN:
LITERAL len = 100;
INT .array[0:len - 1];
INT item := 0;
WHILE item < len DO !WHILE statement
BEGIN
array[item] := 0;
item := item + 1;
END;
!ITEM equals LEN at this point
2. This WHILE loop increments INDEX until a nonalphabetic character occurs:
LITERAL len = 255;
STRING .array[0:len - 1];
INT index := -1;
WHILE (index < len - 1) AND
($ALPHA(array[index := index + 1]))
DO . . . ;