more than 1 command per line?

Monkey Forums/Monkey Programming/more than 1 command per line?

smilertoo(Posted 2012) [#1]
This might be a silly question but how do you put more than 1 command on a line? i tried : and ; but i get 'syntax error - expecting End' errors.
ie If a=2; doSomething1; doSomething; endif


Belimoth(Posted 2012) [#2]
Maybe try
If a=2 Then doSomething1; doSomething; Endif
Semicolon is the right character to use as far as I know.


Jesse(Posted 2012) [#3]
if a=2 dosomething else dosomethingelse ; Separate statement

make sure to use the "Else"

single line if's dont require an "EndIf"


Belimoth(Posted 2012) [#4]
I don't know if he wanted a ternary thing.
Either way I think it's just the semicolon after the If that you don't want.