Decision Based Upon Name Of Switch


(Mike Penda) #1

Hello. I’m trying to put an “if” statement in my app to set a delay based upon the name of a switch passed in as part of the preferences.
For example, if a switch is input as “Greet Jane” or “Greet John”, I want to set something for each within a single app.
Assuming preferences set “theSwitch”.
The statement log.debug "${theSwitch} shows: Greet Jane
But this fails:
if (${theSwitch} == “Greet Jane” {

}
What am I missing?
Thanks!


( I hate Mondays) #2

Put " around the ${theSwitch} and a closing parenthesys:

if ("${theSwitch}" == "Greet Jane") {
...
}

(Mike Penda) #3

Ah. Excellent. Thanks.