7. Program Form
7.1. Blank Lines
-
Completely blank lines are now legal comment lines.
7.2. Program and Block Data Statements
-
A main program may now begin with a statement that gives that program an external name:
-
program work
Block data procedures may also have names.
-
block data stuff
There is now a rule that only
one
unnamed
block data procedure may appear in a program.
(This rule is not enforced by our system.)
The Standard does not specify the effect of the program and block data names,
but they are clearly intended to aid conventional loaders.
7.3. ENTRY Statement
-
Multiple entry points are now legal.
Subroutine and function subprograms may have additional entry points,
declared by an
entry
statement with an optional argument list.
-
entry extra(a, b, c)
Execution begins at the first statement following the
entry
line.
All variable declarations must precede all executable statements in the procedure.
If the procedure begins with a
subroutine
statement,
all entry points are subroutine names.
If it begins with a
function
statement, each entry is a function entry point,
with type determined by the type declared for the entry name.
If any entry is a character-valued function,
then all entries must be.
In a function, an entry name of the same type as that where control entered
must be assigned a value.
Arguments do not retain their values between calls.
(The ancient trick of calling one entry point with a large number of arguments
to cause the procedure to ``remember'' the locations of those arguments,
then invoking an entry with just a few arguments for later calculation,
is still illegal.
Furthermore, the trick doesn't work in our implementation,
since arguments are not kept in static storage.)
7.4. DO Loops
-
do
variables and range parameters may now be of integer, real, or double precision types.
(The use of floating point
do
variables is very dangerous
because of the possibility of unexpected roundoff,
and we strongly recommend against their use).
The action of the
do
statement is now defined for all values of the
do
parameters.
The statement
-
do 10 i = l, u, d
performs
iterations.
The
do
variable has a predictable value when exiting a loop:
the value at the time a
goto
or
return
terminates the loop;
otherwise
the value that failed the limit test.
7.5. Alternate Returns
-
In a
subroutine
or subroutine
entry
statement,
some of the arguments may be noted by an asterisk, as in
-
subroutine s(a, *, b, *)
The meaning of the ``alternate returns'' is described in section 5.2 of the Appendix.