AIPS HELP file for WHILE in 31DEC22
As of Tue Feb 7 1:17:45 2023
Type: Pseudoverb - procedures only
Use: To establish a section of code that will be repeated
until a certain codition becomes false.
Grammar: WHILE condition ; statement1;... ; END
where condition is a logical statement, either a relation
using =, <=, >=, <>, &, ! or a logical variable. The
Used in procedures only.
Statementi are AIPS statements. These statements may not
have an omittted optional immediate numeric argument. Such
statements depend on the POPS stack being empty in the absence
of the argument. But the FOR loop uses the stack for the
'fini' and 'increment' values and so the stack is not empty.
Thus TVON with no argument will see a non-empty stack and
assume that it is getting an immediate argument from the stack.
Use in this case TVON(2**(TVCHAN-1)) inside your loop.
Verbs of this sort include EHEX, GROFF, GRON, HUEWEDGE,
IMWEDGE, REHEX, TVOFF, TVON, TVWEDGE.
Example: WHILE X <> 0; X = X - 1; PRINT X; END
This example will continue to decrement and print X until
X is equal to zero.