EasyManuals Logo
Home>IBM>Desktop>1620

IBM 1620 User Manual

IBM 1620
111 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #30 background imageLoading...
Page #30 background image
Preservation
of
Index Values
Restriction on
Statements
Used in
the
Range
of
a
DO
CONTINUE
Statement
30
In
1620
FORTRAN
it
is possible to transfer into
the
range
of a DO
statement
from
outside its
range
by
either
an
IF
or GO
TO
statement.
(This
cannot
be
done
on
many
other
FORTRAN
programming
systems, and, if there is a possibility
that
the
source
program
will
be
compiled on some
other
FORTRAN
system,
you
should
not
use this
technique. )
If
you write a
statement
to
transfer into
the
range
of a DO from outside of its
range, you
must
understand
that
the
value of
the
index is
not
reset
by
such a
transfer. You
may
use
the
current
value of
the
index or you
may
redefine
the
index
prior to
the
transfer.
If
you
want
to use
the
current
value
of
the
index,
read
the
next
paragraph
carefully,
and
then
review
the
explanation of "Test Value."
The
current
value of
the
index
in
a problem
may
not
be
what
you
think
it
is.
When
the
program
transfers
out
of
the
range of a DO
in
the
normal
manner
(that
is,
when
the
DO becomes satisfied
and
the
program
transfers to
the
next statement
after
the
range),
the
exit is defined as a
normal
exit. After a normal exit from a DO
occurs,
the
value of
the
index is
not
redefined to its original value.
To
determine
the
value of
the
index after a normal exit,
remember
that
after
a loop is completed,
the
index is increased
by
the
increment
before
it
is tested to determine
if
additional
loops
are
to
be
taken.
When
the
program
transfers
out
of
the
range
of a DO
by
an
IF
or
GO
TO
state-
ment,
the
value of
the
index is its
current
value
at
the
time
of
the
transfer.
In
both
types of exits,
the
current
value of
the
index is preserved for any sub-
sequent
use.
If
the
exit occurs
by
a transfer which
is
in
the
range
of
several DO'S,
the
current
values of all
the
indexes controlled
by
those
Do'S
are
preserved for any
subsequent
use.
The
range
of a DO
cannot
contain any
statement
which redefines
the
value of the
index
or
the
value of any of
the
indexing parameters (mJ, mil,
or
mJ)'
The
indexing
of a
DO
statement
must
be
completely
set
before
the
range
of
the
DO is entered.
The
first statement in
the
range
of a DO cannot
be
the
control statement
CONTINUE.
The
CONTINUE
statement
is
sometimes referred to as a "nonexecutable"
statement;
that
is, a
statement
in
the
source program
that
does
not
create
instruc-
tions in
the
object program.
The
nonexecutable instructions
DIMENSION
and
FORMAT
can
be
the
first
statement
in
the
range
of a DO. These two instructions
are
described
later.
The
last statement
in
the
range
of a DO
must
not
be
a
program
transfer state-
ment
(IF
or GO
TO,
etc.)
or
a specification statement
(FORMAT
or
DIMENSION).
This
statement
is
used
as
the
last
statement
in
the
range of a DO
when
the
last state-
ment
would
otherwise
be
a
program
transfer statement
(see
rule
previously given) .
This
statement
does
not
create
any
instructions
in
the
object program.
Format:
I~"_C_O_N_T_I_N_U
__
E_"
______________________________
~
Example:
CONTINUE
~----------------------------------------------~
Consider
the
following table search program which requires a
CONTINUE
state-
ment. This program will scan
the
100-entry array
named
VALUE
until
it
finds an
element which equals
the
value of
the
variable
named
ARG,
then
the
program will
transfer to
statement
20
with
the
value of I available for use.
If
no element in
the
array is
equal
to
the
value of ARG,
the
program
is
transferred to
statement
12.
No
operations
are
performed
by
the
CONTINUE
statement;
the
program
merely con-
tinues
with
the
next sequeritial
statement
following
statement
12.

Other manuals for IBM 1620

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM 1620 and is the answer not in the manual?

IBM 1620 Specifications

General IconGeneral
BrandIBM
Model1620
CategoryDesktop
LanguageEnglish

Related product manuals