AIPS HELP file for THEN in 31DEC22
As of Wed Jan 26 22:04:08 2022
Type: Psuedoverb - procedures only
Use: Used in the IF construction (see IF) to seperate the
logical condition from the statements to be executed
if that condition is true.
Grammar: IF condition THEN statement1;...
ELSE statementn;...; END
IF condition THEN statement1;...;END
where condition is a relational condition using =, <=, >=, <>,
&, ! or a logical variable. Statementi are AIPS statements.
The statements may be separated by semi-colons as shown above
or they may be on separate lines. IF-THEN-ELSE may be used in
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.
Examples: IF A = B THEN PRINT 'A = B'; A=7;
ELSE PRINT 'A <> B'; A=8; END
IF A <= B THEN PRINT 'A <= B'; C=9; END