IF

From Smart Box
Revision as of 19:17, 6 October 2023 by Benryves (talk | contribs) (Created page with "== Syntax == IF condition THEN action ELSE action == Description == The IF command is used to test for a certain condition and then perform an action. The command can be extended using the word ELSE to perform one action if the condition is true or another if the condition is false. == Examples == IF SENSOR 1 IS ON THEN FORWARD A IF SENSOR A IS GREATER THAN 128 THEN SWITCH ON 1 ELSE SWITCH OFF 1 == Associated keywords == * THEN * ELSE Category:Re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax[edit]

IF condition THEN action ELSE action

Description[edit]

The IF command is used to test for a certain condition and then perform an action. The command can be extended using the word ELSE to perform one action if the condition is true or another if the condition is false.

Examples[edit]

IF SENSOR 1 IS ON THEN FORWARD A
IF SENSOR A IS GREATER THAN 128 THEN SWITCH ON 1 ELSE SWITCH OFF 1

Associated keywords[edit]