April 1, 1981 30U VM/370 eMS User's Guide
Section 16. Refining Your EXEC Procedures
This section provides supplementary information for writing complex EXEC procedures. Although the EXEC interpreter resembles, in some aspects, a
high-level programming language, you do not need to be a programmer to
write EXECs. Some of the techniques suggested here, for example, on
annotating and writing error messages, are common programming practices,
which help make programs self-documenting and easier to read and to use.
Annotating EXEC Procedures
Lines in an EXEC file that begin with an asterisk (*) are commentary and
are treated as comments by the EXEC interpreter. You can use *
statements to annotate your EXECs. If you write EXECs frequently, you
may find it convenient to include a standard comment at the beginning of
each EXEC, indicating its function and the date it was written, for
example:
* EXEC TO HELP CONVERT LISTING FILES
* INTO SCRIPT FILES
* J. BEAN 10/18/75 You can also use single asterisks or null lines to
between lines in an EXEC file to make examining the file
provide spacing
easier.
In an EXEC, you cannot place comments on the same line with an
executable statement. If you want to annotate a particular statement or
group of statements, you must place the comments either above or below
the lines you are annotating.
A good practice to use, when writing EXECs, is to set them up to
respond to a 1 (question mark) entered as the sale argument. For
example, an EXEC named FSORT might contain: SCONTROL OFF SIF SINDEX = 1 SIF S1 = ? SGOTO -TELL
-TELL SBEGTYPE CORRECT FORM IS FSORT USERID <VADDR> ' PRINTS AN ALPHABETIC LISTING OF ALL FILES ON THE SPECIFIED USER'S DISK. IF A VIRTUAL ADDRESS (VAtDR) IS NOT SPECIFIED, THE USER'S 191 IS THE DEFAULT. &END You may also wish
enter an EXEC name
arguments:
to anticipate the situation -in which a user might
with no arguments for an EXEC that requires
Section 16. Refining Your EXEC Procedures 305
Previous Page Next Page