EasyManua.ls Logo

Sharp MZ-800 - Page 80

Sharp MZ-800
221 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
IF
~GOSUB
Format
IF
|
<relational
expression>
|
GOSUB
|
<line
number
>
<logical
expression>
|
|
<label>
Abbreyiated
Format
IF
~GOS.
Explanation
The
IF
~
GOSUB
statement
evaluates
the
condition
defined
by
<
relational
or
logi-
cal
expression
>.
If
the
condition
is
satisfied,
the
program
execution
branches
to
the
subroutine
beginning
on
the
line
number
specified
in
<line
number>
or
<label>.
Upon
completion
of
the
subroutine,
execution
returns
to
the
first
executa-
ble
statement
following
the
calling
IF~GOSUB
statement.
Therefore,
if
multiple
statements
are
included
on
the
line
with
the
IF
~GOSUB
statement,
execution
returns
to
the
first
statement
following
IF~GOSUB.
10
INPUT
"”
X=
"";X
20
IF
X<O
GOSUB
100:PRINT
*’*X<0"’
30
IF
X=0
GOSUB
200:PRINT
‘’X=0"
40
IF
X>O
GOSUB
300:PRINT
''X>0"’
50
PRINT
'*
#*#
#
kek
RR RR
RR
RRR
RR!
60
GOTO
10
100
PRINT
‘’
*
PROGRAM
LINE
100
‘':RETURN
200
PRINT
‘'
*
PROGRAM
LINE
200
‘':RETURN
300
PRINT
‘'
*
PROGRAM
LINE
300
‘*:RETURN
See
also
GOSUB
~
RETURN
IF
~
THEN
~
:ELSE
IF~GOTO
6-23

Other manuals for Sharp MZ-800

Related product manuals