Data Sheet

dScript
dScript User Manual v2.15
if - multiple statement execution
the syntax of the if command is:
if <condition> then
statements
elseif <condition>
statements
else
statements
endif
The compiler used the "then" keyword that follows the <condition> to determine if this is the
single or multiple format of the "if" statement.
The "elseif" command can follow "then" or "elseif" commands and must terminate with "elseif",
"else" or "endif".
The "else" command can follow "then" or "elseif and must finish with the "endif" command.
The final block of statements must be terminated with the "endif" command.
An example:
LedRed = off
LedBlue = off
LedGreen = off
x = 2
if x == 1 then
LedBlue = on
a = 21
elseif x == 2
LedRed = on
a = 45
else
LedGreen = on
a = 193
endif
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
25