Introduction to Command Procedure Scripts

     

VISTA can store several commands in a list and execute them as a program. A list of such commands is termed a PROCEDURE. The list is stored in a special buffer, called the 'procedure buffer'.

Almost any VISTA command that has proper syntax can be used in a procedure. The basic commands for creating, storing, and modifying procedures are these:

PEDIT
edits the current procedure buffer.
WP
stores the procedure buffer on the disk.
RP
reads the procedure from disk.
SHOW
displays the procedure buffer
GO
begins execution of the procedure.
There are several 'control commands' that effect the operation of a procedure.
VERIFY
executes a procedure line by line, to aid in debugging.
PAUSE
pauses during execution of a procedure.
CALL
runs a procedure as a subroutine.
RETURN
returns from a procedure used as a subroutine.
DO, END_DO
define a loop in a program for execution a given number of times,
GOTO
jumps to another place in the procedure.
:
defines a place to jump to in the procedure.
IF, END_IF
define a block of commands that are executed only under certain conditions.
ELSE, ELSE_IF
control branching for branching that has many options.
This list serves not only as an introduction to those not familiar with procedures, but illustrates the flexibility that procedures give to VISTA programming. A defined procedure eliminates the boredom of typing repetitive commands over and over, but it does much more than that: it greatly expands the functions of VISTA so that new applications do not always require new subroutines. A familiarity with procedures will make your data reductions more efficient.

IMPORTANT:
Do NOT put any of the flow-control statements (DO, IF, END_DO, etc.) with other commands on a line. They must appear separately. Thus:

   DO I=1,10}
   DO J=1,10}
      (some stuff)}
   END\_DO; END\_DO
or similar constructions, will NOT work properly!

As the VISTA program begins, it executes the procedure stored in the file defined by the environment variable V_STARTUP. For example, if you had defined V_STARTUP through

   setenv V_STARTUP ./myprocs/myproc.pro
before running VISTA, then myprocs/myproc.pro will be executed as the program begins. Typically, the startup procedure will contain definitions of aliases, the setting of symbol values, or the reading into buffers of repeatedly-used images. This procedure is not saved in the procedure buffer as it is executed.