8-146Trio BASIC Commands
Mathematical Operations and Commands
Trio Motion Technology
OR
Type:
Logical and bitwise operator
Description:
This performs an
OR
function between corresponding bits of the integer part of two
valid Trio BASIC expressions. The
OR
function between two bits is defined as follows:
Parameters:
Example 1:
IF KEY OR IN(0)=ON THEN GOTO label
Example 2:
result=10 OR (2.1*9)
Trio BASIC evaluates the parentheses first giving the value 18.9, but as was speci-
fied earlier, only the integer part of the number is used for the operation, therefore
this expression is equivalent to:
result=10 OR 18
The OR is a bitwise operator and so the binary action taking place is:
01010
OR 10010
----------
11010
Therefore result holds the value 26
OR 0 1
001
111
Expression1:
Any valid Trio BASIC expression
Expression2:
Any valid Trio BASIC expression