AIPS HELP file for PROC in 31DEC18
As of Thu Jul 19 0:07:09 2018
PROC or PROCEDURE
Use: To declare a procedure name and calling sequence and to begin the
compilation of the procedure.
Grammar: PROC name ( adv1, adv2, adv3, ..., advn)
where name is the desired procedure name and the advi are the
names of dummy variables used to pass values when the procedure
is called and to return values when the procedure exits. If name
has already been declared as a procedure, the old procedure will
be destroyed by this pseudoverb. You may have any number of
dummy arguments from 0 to 10 or so. They may be scalars, arrays,
or strings. New scalar adverbs may be created by this
pseudoverb. However, if the dummy argument is to be a string or
an array, it must have been declared as such before the present
use of PROC. When the procedure is invoked, the calling
arguments must agree in number, type, and dimension with the
specified dummy arguments. After handling the PROC statement,
AIPS will go into a compile mode and prompt you for input with :
sign. This mode ends with the FINISH statement. The code
generated during compilation is stored away and may be executed
by giving the procedure name together with any calling arguments.
Example: PROC DUMMY (STRA3, ARRAY2, X)
where STRA3 and ARRAY2 are a string and an array known before and
X is to be a new scalar adverb.
Note: Bad choices for the name of the procedure can cause problems. It
should not match in its first characters any task you intend to
use. For example, if a procedure called FRINGIT is created, then
GO FRING will actually do TPUT FRINGIT; FRINGIT since the POPS
parser does not know any task names. Of course, in this case you
could say TASK='FRING'; GO; and keep FRINGIT as a proc name, but
you would have to remember never to use the immediate argument
form for FRING.