; PROC ;--------------------------------------------------------------- ;! Define a POPS procedure using procedure editor. ;# VERB POPS ;----------------------------------------------------------------------- ;; Copyright (C) 1995, 1998 ;; Associated Universities, Inc. Washington DC, USA. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 2 of ;; the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, ;; MA 02139, USA. ;; ;; Correspondence concerning AIPS should be addressed as follows: ;; Internet email: aipsmail@nrao.edu. ;; Postal address: AIPS Project Office ;; National Radio Astronomy Observatory ;; 520 Edgemont Road ;; Charlottesville, VA 22903-2475 USA ;----------------------------------------------------------------------- ;--------------------------------------------------------------- PROC LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC ---------------------------------------------------------------- PROC or PROCEDURE Type: Pseudoverb 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. ----------------------------------------------------------------