EasyManuals Logo

Sharp MZ-800 User Manual

Sharp MZ-800
221 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 #79 background imageLoading...
Page #79 background image
IF~GOTO
Format
Explanation
Example
IF
|
<relational
expression>|
GOTO
|
<line
number>
|
<logical
expression>
|
|
<label
>
Abbreviated
Format
IF~G.
The
IF
~
GOTO
statement
sequence
evaluates
the
condition
defined
by
<relational
or
logical
expression
>
,
then
branches
to
the
line
number
specified
in
<line
number>
or
<label>
if
the
condition
is
satisfied.
As
with
the
IF~THEN
sequence,
IF
~
GOTO
is
used
for
conditional
branching.
When
the
specified
condition
is
satis-
fied,
the
program
execution
jumps
to
the
line
number
specified
in
<line
number
>
or
<label>.
If
the
condition
is
not
satisfied,
execution
continues
with
the
next
line
of
the
program.
(Any
statements
following
IF~
GOTO
on
the
same
program
line
will
be
ignored.)
10
T=0:N=0
20
INPUT
‘‘VALUE='';X
30
IF
X=999
GOTO
100
40
T=T+X:N=N+1
50
GOTO
20
100
PRINT
'*####
eee
RHR”
110
PRINT
“'TOTAL:";T
120
PRINT
‘‘NO.
ENTRIES:’’;N
130
PRINT
“‘AVERAGE:"';T/N
140
END
The
above
example
gives
the
total
and
average
of
input
values.
If
999
is
input,
pro-
gram
execution
is
terminated.
GOTO
IF
~
THEN
~
:ELSE
IF
~GOSUB
6-22

Other manuals for Sharp MZ-800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sharp MZ-800 and is the answer not in the manual?

Sharp MZ-800 Specifications

General IconGeneral
BrandSharp
ModelMZ-800
CategoryDesktop
LanguageEnglish

Related product manuals