04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OR<br />

XOR<br />

Structure - Math<br />

The OR operator is a logic comparison operator. It compares two conditions to make a single true or<br />

false statement. The OR operator will return a true if one or both conditions are true. If both conditions<br />

are false then a false is returned. The truth table belwo demonstrates all combinations:<br />

Condition 1 Condition 2 Result<br />

True True True<br />

True False True<br />

False True True<br />

False False False<br />

The OR operator is used in decision making commands such as IF..THEN, DO..WHILE and so on. It<br />

differs from the | operator which is used in binary math functions. Example of the OR operator:<br />

if hour = 12 OR minute = 30 then ding<br />

The conditional statement will check to see if either expression is true before returning a true and<br />

jumping to the ding label. If both of the expressions are false the label is skipped. The IF..THEN only<br />

jumps to the label if the statement is true.<br />

The XOR operator is a logic comparison operator. It compares two conditions to make a single<br />

true or false statement. The XOR operator will return a true if one but not both conditions are true.<br />

If both conditions are true or false then a false is returned. The truth table below demonstrates all<br />

combinations:<br />

Condition 1 Condition 2 Result<br />

True True False<br />

True False True<br />

False True True<br />

False False False<br />

The XOR operator is used in decision making commands such as IF..THEN, DO..WHILE and so on. It<br />

differs from the ^ operator which is used in binary math functions. Example of the XOR operator:<br />

if hour > 5 XOR hour = 5 then QuitTime<br />

The conditional statement will check to see if either expression is true before returning a true and<br />

jumping to the quittime label. If both of the expressions are false or true the label is skipped. The IF..<br />

THEN only jumps to the label if the statement is true.<br />

61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!