I am trying to write something comparable to an If, else if, else statement. However, the online compiler is giving me problems.
I usually write my code in jquery and just emit it… but I am trying to do it the KRL way this time and I am running into problems.
When I write something like the following (between the Pre and Post blocks), I get compiler errors:
if (someExpression) then {
//Do some code
} else {
//DO some code
}
I know that there is a reason… but I need someone to explain it to me… or point me to the documentation.
You can use ternary operators in the pre block for variable assignment as illustrated at http://kynetxappaday.wordpress.com/2010/12/21/day-15-ternary-operators-or-conditional-expressions/
You can also conditionally raise explicit events based on whether the action block fired or not as illustrated at http://kynetxappaday.wordpress.com/2010/12/15/day-6-conditional-action-blocks-and-else-postludes/