Forum Discussion
kbenson
16 years agoVisitor
Single line if statements don't require an end if, in the same vein as single line if statements in C/C++, PHP, etc. don't require braces.
In C:
There is a solution to your problem in BrightScript. Use colons to separate multiple statements on a single line.
Note that it's a colon, not a semicolon, like many other languages. Don't get them confused...
In C:
if (boolean)
statement;
not_part_of_if_statement();
There is a solution to your problem in BrightScript. Use colons to separate multiple statements on a single line.
if x=1 : x = x+1 : y = y-1 : end if
function myfunc() : return "test" : end function
if x=1 : print "1"
elseif x=2 : print "2"
elseif x=3 : print "3"
else : print "I dunno"
end if
Note that it's a colon, not a semicolon, like many other languages. Don't get them confused...