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 #27 background imageLoading...
Page #27 background image
An index,
J,
is established which will
be
increased
by
1
each
time
statement
10 is executed.
Statement
5 sets J to zero
(this
statement
is processed
on
the
first loop
only)
so
that
statement
10 will set J
equal
to 1 for
the
first execution
of
statement
25.
Statement
25 will
compute
the
current
stock on
hand
by
subracting
the
stock
withdrawal
from
the
previous stock
on
hand.
The
first
time
statement
25
is
executed,
the
stock
on
hand
of
the
first
item
in
inventory,
INV(
1),
will
be
com-
puted
by
subtracting
the
stock
withdrawal
of
that
item,
lOUT
(
1).
Statement
15
tests to determine
if
all items
in
stock
have
been
updated.
not,
the
expression
1000-J will
be
positive
and
the
program will transfer to
statement
10,
which
will
increase
the
value
of J
by
l.
Statement 25 will
be
executed again, this time for
the
stock
on
hand
of
item
2,
INV(2),
and
the
stock
withdrawal
of
item
2,
IOUT(2).
This
procedure
will
be
repeated
until
the
stock of
item
number
1000 has
been
updated.
At
this point, J will
be
equal
to 1000,
and
the
expression
in
statement
15
will
be
equal
to zero. At this time,
statement
15 will cause
the
program
to
transfer to
statement
20
in
order
to continue
with
other
parts of
the
program.
Notice
that
three
statements (5, 10,
and
15)
were
required
for this looping
which could
have
been
accomplished
with
a single
DO
statement.
The
purpose
of
the
DO
statement is to simplify
the
programming
of loops
and
to provide greater flexibility
in
looping.
Format:
Example:
"DO
n i =
m],
m
2
,
ms"
where
n is a
statement
number,
i a fixed
point
variable,
and
mJ, m
2
and
mJ
can
be
either a fixed
point
constant or a
fixed
point
variable.
Subscripts
and
sign indication
are
not
permitted
in a
DO
statement.
If
ms
is
not
stated,
it
is
taken
to
be
l.
The
commas
are
required
punctuation.
DO
20 JBNO =
1,
10
DO
20 JBNO =
1,
10, 2
DO
20 JBNO =
K,
L, 3
DO
16K
=
1,
M
DO
16 J =
L,2
DO
18
INDEX
=
J,
K
The
DO
statement
is a command to
repeatedly
execute
the
statements
that
fol-
low
the
DO
statement,
up
to
and
including
statement
number
n.
The
first
time
through
the
loop,
the
statements
are
executed
with
i
equal
to
the
value
of
mj'
For
each
succeeding execution of
the
statements, i is increased
by
the
value
of m
3
After
the
statements
have
been
executed
with
i
equal
to
the
highest
value
that
does
not
exceed m2,
the
program
transfers to
the
statement
which follows
the
last
statement
in
the
range
of
the
DO
(the
statement
after
statement
number
n).
Thus,
the
DO
statement
does
three
things:
l.
It
establishes
an
index which
may
be
used
as a subscript or
in
a computa-
tion.
2.
It
causes looping
through
any desired series of statements as
many
times
as required.
3.
It
increases
the
index
(by
any
amount
specified) for
each
separate
execu-
tion
of
the
series of statements
in
the
loop.
Writing the 1620
FORTRAN
Program 27

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