Sharp MZ-700 Series Owner's Manual page 53

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

Advertisement

E x a m p l e
F • • = • • • • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - • • • T H E N
F - - T H E N
P — • • • T H E N
1 00
G O T O
o r
I F
G O T O
P R I N T
o r
I F
T H E N
<?
A = 5 ^ 7
assignment
1 = 1 0 : J =
5 0
I N P U T
R E A D
G O S U B
R E T U R N
S T O P
E N D
Examples of logical and relational expressions
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.
I F
A $ = ' X Y Z "
If the contents of string variable A$ equal
T H E N -
"XYZ",
execute
the
statements
following
C / 3 a
THEN.
o "t/5
G O
>
I F
A > X
T H E N -
If the value of variable A is greater than X,
< L > V - 4
execute the statements following THEN.
< L > V - 4
<
I F
A < X
T H E N -
If the value of variable A is less then X, execute
C J
the statements following THEN.
< > or > <
I F
A O X T H E N -
If the value of variable A is not equal to X,
execute the statements following THEN.
Pi
> = or = >
I F A > = X T H E N -
If the value of variable A is greater than or
equal to X, execute the statements following
THEN.
< = or = <
I F A < = X T H E N - - -
If the value of variable A is less than or equal to
X, execute the statements following THEN.
c n C
*
I F ( A > X ) * ( B > Y )
If the value of variable A is greater than X.and
o
T H E N -
the value of variable B is greater than Y, execute
<D
| H ft
the statements following THEN.
< D
•a
o
* 5 b
+
I F ( A > X ) + ( B > Y )
If the value of variable A is greater than X or
< D
•a
o
* 5 b
T H E N - - -
the value of variable B is greater than Y, execute
O
hJ
the statements following THEN.
51

Advertisement

Table of Contents
loading

Table of Contents