AIPS HELP file for ELSE in 31DEC18
As of Thu Jan 18 18:45:46 2018
Use: Used in the IF construction (see IF) to identify a set of
statements to be executed if a logical condition is false
Grammar: IF condition THEN statement1;...
ELSE statementn;...; END
where condition is a logical statement, either a single
"logical" variable or 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 only in procedures.
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