BASIC
String operations:
<. >.
=,<=> =
,
<>
For example,
in
the
line:
X*X +
5[2.8
BASIC will find the value of 5 to
the
2.8
power. Next, it will
multiply
X
*
X,
and
finally
add this value to the value of 5 to
the 2.8. If you want BASIC to perform the
indicated
operations in a different order, you must
add parentheses
.
For
example:
X*(X
+
5[2.8)
or
X*(X
+
5)[2.8
Here's
another example:
IF X
=
OR Y>0
AND Z=1
THEN 255
The relational operators
=
and
>
have the highest
precedence, so BASIC
performs them first, one after the next,
from left to right. Then the
logical
operations are performed. AND has a
higher precedence than OR, so BASIC
performs the AND operation before OR.
If the above
line looks confusing because you
can't remember which operator is
precedent
over which
,
then you can use parentheses
to make the sequence
obvious:
IF X
=
OR ((Y>0)
AND (Z=1))
THEN
255
121