EasyManuals Logo

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 #28 background imageLoading...
Page #28 background image
28
In
the
example below,
an
inventory
problem
is
programmed
using
the
DO
statement.
STATEMENT
FORTRAN
STATEMENT
NUMBER
I
S 6 7
10
IS
20
2S
30
3S
40
4S
SO
S5
I
I I I
I I I
I
I I
I
I
I I
I
I
I I
15
DO
2.5
J= I 1000
,
I I
25
INV
.(J)
=I,NV(J) -.IOUT,(S)
35
I
I
I I
I I I
I
I I
I
.
I
I
I I
I I
, I
I
Statement
15 is a
command
to execute
the
following statements
up
to
and
includ-
ing
statement
25;
the
first time
the
value of J will
be
1,
thereafter
the
value of J
will
be
increased
by
1 for
each
execution
of
the
loop until
the
loop has
been
executed
with
the
value of J
equal
to 1000. After
the
loop has
been
executed
with
J
equal
to 1000,
the
statement
following
statement
25 will
be
executed.
The
following is a comparison of
statement
15
with
the
format of a
DO
state-
ment,
and
an
introduction
to some of
the
terms
used
in describing a
DO
statement.
DO
Format
n
DO
Statement
25
J
L-y-----'
L-y-----'
Range
Index
m
J
,
1,
L.y-'
Initial
Value
n1
2
,
1000
L~
Test
Value
m.
1
L~
Increment
The
range
is
the
series
of
statements to
be
executed repeatedly.
It
consists
of all statements following
the
DO
statement
up
to
and
including
statement
n.
In
this case,
statement
n
is
statement
25,
and
the
range
consists of only
one
state-
ment.
The
range
can
consist of
any
number
of
statements.
(NOTE:
throughout
the
remainder
of
the
manual,
the
word
DO
means
the
DO
statement
and
all state-
ments within
the
range
of
the
DO
statement.)
The
index
is
the
variable
which
will
change
for
each
execution of
the
range.
In
the
example,
the
index J was also
used
as
the
subscript
to
the
variables
in
statement
25. Thus,
it
served
two
purposes: to
maintain
a
count
of
the
number
of
loops executed,
and
to establish
the
correct
variable
for
each
execution of
the
loop.
The
initial
value
is
the
value
of
the
index
for
the
first execution of
the
range.
Although
the
initial
value
was 1 for this example,
in
another
problem
it
might
be
some
other
quantity. Often,
the
initial
value
will
be
required
to
change
at
differ-
ent
times
within
the
program.
In
such
cases
it
may
be
stated
as a fixed
point
variable
rather
than
as a constant, as
in
the
example.
If
it
is
a variable, its
value
must
be
set
up
in
a
statement
that
precedes
the
DO
statement.
The
increment
is
the
amount
by
which
the
value
of
the
index will
be
increased
after
each
execution
of
the
range.
In
the
example,
it
is
not
coded
because
the
in-
crement
desired
is 1
and
the
DO
statement
automatically uses
1,
unless some
other
value is specified. As
with
the
initial
value,
the
increment
may
be
written
as a
fixed
point
variable.

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
CategoryDesktop
ManufacturerIBM
Model1620
Introduced1959
WeightApproximately 1, 000 pounds
Memory20, 000 to 60, 000 digits
ProgrammingFORTRAN, Symbolic Programming System (SPS)
CPUDecimal, variable word length
StorageMagnetic disk drive (IBM 1311)

Related product manuals