Download 5300-5600_BASIC_Reference_en-US_RevA

Transcript
Relational
Relational operators are used in IF-THEN-ELSE, WHILE-WEND,
and FOR-NEXT statements. The result of a comparison of two
values with these relational operators is recorded by Pacific
Scientific StepperBASIC as either true or false. The relational
operators are:
Relational
Operator
Description of
Operation
Example
Equality
10
IF INT1 = 9 THEN 20
<>
Inequality
50
IF FLT1 < > 9 THEN 15
<
Less than
30
IF INT2 < 151 THEN 100
>
Greater than
10
IF FLT1 > INT2 THEN 20
<=
Less than or
equal to
10
IF FLT1 <= INT2 THEN 20
>=
Greater than or
equal to
10
IF INT3 >= INT5 THEN 20
=
Note: Arithmetic operators are performed before relational
operators in an executing program line. Relational operators are
performed in the order of precedence shown in the table.
Rev F
StepperBASIC Reference Manual
1 - 5