Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: belliveaujdOriginally posted by: jpstory
Hi
I am trying to do something like this:
If TestNumber > 0 then Result1 = "Greater than zero" and Result2 = "It's a positive number" and Result3 = "It's not negative"
I have tried using all kinds of brackets to group the 3 results but none worked.
Any way I can get it to work without breaking it into 3 separate If .... Then... statements?
Here's a working example making use of the brackets to encapsulate multiple lines of code in a single "if" conditional statement. Simply copy and paste the code below into the Lavastorm canvas.
NOTE: the "If" is case sensitive and should be "if"
node:Static_Data
bretype:core::Static Data
editor:sortkey=56ab85094f39288d
output:@40fe6c55598828e5/=
prop:StaticData=<<EOX
TestNumber:int
-1
-2
-3
1
2
3
EOX
editor:XY=130,100
end:Static_Data
node:Filter
bretype:core::Filter
editor:sortkey=56ab852a381637c4
input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
output:@40fd2c7420761db6/=
prop:Script=<<EOX
Result1 = str(null)
Result2 = str(null)
Result3 = str(null)
if TestNumber > 0 then {
Result1 = "Greater than zero"
Result2 = "It's a positive number"
Result3 = "It's not negative"
}
emit *
emit Result1, Result2, Result3
EOX
editor:XY=230,100
end:Filter