Sharp MZ-700 Owner's Manual page 53

Hide thumbs Also See for MZ-700:
Table of Contents

Advertisement

Example
I
F
··· ···THEN
1
00
I F
······
T
H
EN
GOTO
or
I
F·· ····GOTO
I F·
··
···THEN
PR
I
N
T
or
I
F····
··
THEN
?
I
F
····
··T
H
EN
A
=
5*7
assignment
I F
··
····THEN
1=1
0
:0=5
0
I
F···
··
·THEN
INPU
T
I
F······THEN
READ
I
···
··THEN
GO SUB
I
F····· ·T
HE
N
R
ET
URN
I
F··
····T
H
EN
S
T
OP
I
F
····· ·THEN
E
ND
Examples of logical and relational expressions
-~
"'
"'
Q)
~
Q)
Oil
Operator
>
<
Sample application
-
Explanation
I
F
A= X
T H
E
N
··
·
If the value of numeric variable A equals the
value of
X,
execute the statements following
THEN.
IF
A$
=
"
XYZ
"
T
HEN···
IF
A>X
THEN···
IF
A<X
TH
EN·
··
If the contents of string variable A$ equal
"XYZ", execute the statements following
THEN.
If
·
t he value of variable
A
is greater than X,
execute the statements following THEN.
§
<>
or
><
~
IF A<>X
THEN···
If the value of variable
A
is less then
X,
execute
the.
statements following
THEN.
If the value of variable A is not equal to X,
execute the statements following
THEN.
~
>
= or=
>
I
F A>
=
X
THEN···
If the value of variable A is greater than or
equal to
X,
execute the statements following
THEN.
<
=
or
=
<
I
F A<
=
X
THEN···
If the value of variable A is less than or equal to
X, execute the statements following THEN.
*
+
I
FCA
>X)*CB>Y)
T
HEN··
·
I FCA>X)
+
CB>Y)
THEN··
·
If the value of variable
A
is greater than
X_and
the value of variable B is greater than Y, execute
the
statements
following THEN.
If the value of variable A is greater than X or
the value of variable B is greater than Y, execute
the statements following THEN.
------------------------------------------------------------------------51

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents