EasyManuals Logo
Home>IBM>Laptop>5100

IBM 5100 Basic Reference Manual

IBM 5100
187 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 #81 background imageLoading...
Page #81 background image
(
(
(
(
(
GOTO line-num
[Lline-numl
...
ON
arith-exp
]
GOTO
The GOTO statement transfers control either conditionally
or
unconditionally
to
a
specified statement.
The syntax
of
the GOTO statement can
be
simple or computed. The simple syntax
is:
GOTO line-num
where:
line-num
is
the number
of
the
statement
to
which control
is
to
be transferred.
The computed GOTO syntax
is:
GOTO line-num [,Iine-numl
•..
ON arith-exp
where:
line-num
is
a string
of
statement numbers separated by commas.
At
least one
statement number
is
required.
arith-exp determines the statement
to
which control
is
passed.
Execution of a simple GOTO statement causes an unconditional transfer
of
control
to
the statement number specified.
Execution of a computed GOTO statement causes
the
arithmetic expression
to
be
evaluated and control transferred
to
the
statement whose numeric position
in
the
list
of
statement numbers (reading left
to
right)
is
equal
to
the truncated integer
value
of
the
expression. Thus,
an
expression with a value
of
2.75 would cause con-
trol
to
be transferred
to
the
second statement
in
the list.
If
the
expression has a
value
less
than 1
or
greater than
the
total number
of
statements listed, control falls
through
to
the first executable statement following
the
computed GOTO
statement.
When a simple
or
computed
GbTO
statement transfers control
to
a nonexecutable
statement, control
is
then passed
to
the
first executable statement following
the
specified nonexecutable statement.
The following statement
will
unconditionally pass control
to
statement number
20:
100 GOTO 20
If
X = 4,
the
following statement will pass control
to
statement number 60:
50 GOTO 40, 60, 15, 100
ON
(X+4)/4
77

Table of Contents

Other manuals for IBM 5100

Questions and Answers:

Question and Answer IconNeed help?

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

IBM 5100 Specifications

General IconGeneral
BrandIBM
Model5100
CategoryLaptop
LanguageEnglish

Related product manuals