FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-23
CONTINUE Statement
Example
The following example shows how the main program unit shares data with a subroutine
and function subprogram through the use of common blocks. The same area of blank
common is used in the main program and in the function COST OF SALES. The
common block SALES is used in the main program and in the subroutine
SALESREPORT.
PROGRAM main
COMMON product, price
COMMON /sales/salesman, commission
.
END
SUBROUTINE salesreport(x, y)
COMMON /sales/salesrep, commission due
.
END
FUNCTION cost of sales ()
COMMON item, price
.
END
CONTINUE Statement
The CONTINUE statement does nothing except provide a location for a statement
label. It is most often used as the last statement of a DO loop.
Considerations
The CONTINUE statement is an executable statement. You can place it anywhere in
the executable statement portion of a program without affecting the sequence of
execution.
Typically, you use a CONTINUE statement as the last statement of a DO loop, but it is
required at the end of a DO loop only if a GO TO or IF statement would otherwise be
the last statement of the loop.
CONTINUE