Code: Select all
x := 2
myVar := (x > 1) ? 101 : 404
Code: Select all
x := 2
myVar := (x > 1) ? msgB() : msgB2()
msgB(){
msgBox % "True"
}
msgB2(){
msgBox % "False"
}
Code: Select all
x := 2
(x > 1) ? msgB() : msgB2()
msgB(){
msgBox % "True"
}
msgB2(){
msgBox % "False"
}
From what I know from other programming languages ternary can only be used with an assignment, yet here it's working fine without one?
Is this intended or is it some sort of a bug that shouldn't be there? If it shouldn't be there, would you recommend using it anyway or just stick to the normal usage of ternary?