Multiple/Embedded If's ... should that work?
Posted: 16 Jan 2014 17:35
I am using the Input Dialog to have the user provide a Single Choice. This Single Choice is in text and is one of four possibilities:
"Sleeping Pills"
"Test Cassettes"
"NovoRapid"
"Lantus"
When the user chooses one of these option though I want a "number" copied to clipboard, i.e.
If user chooses "Sleeping Pills" then "1234567" is sent to clipboard
If user chooses "Test Cassettes" then "2345678" is sent to clipboard
If user chooses "NovoRapid" then "3456789" is sent to clipboard
If user chooses "Lantus" then "4567890" is sent to clipboard
I tried using an embedded "If" statements in script to do this (i.e. If "Sleeping Pills" then make a variable = "1234567" else if, else if, etc. then copy variable to clipboard), I also tried using compounded Conditions (in a similar fashion as if statements) to do this. But the only time it seems to work is when the first choice ("Sleeping Pills") is chosen, otherwise "null" is copied to the clipboard. It's as though after the first If statement is executed the {value} variable loses it's value or something, I don't get it... any thoughts? Thanks!
"Sleeping Pills"
"Test Cassettes"
"NovoRapid"
"Lantus"
When the user chooses one of these option though I want a "number" copied to clipboard, i.e.
If user chooses "Sleeping Pills" then "1234567" is sent to clipboard
If user chooses "Test Cassettes" then "2345678" is sent to clipboard
If user chooses "NovoRapid" then "3456789" is sent to clipboard
If user chooses "Lantus" then "4567890" is sent to clipboard
I tried using an embedded "If" statements in script to do this (i.e. If "Sleeping Pills" then make a variable = "1234567" else if, else if, etc. then copy variable to clipboard), I also tried using compounded Conditions (in a similar fashion as if statements) to do this. But the only time it seems to work is when the first choice ("Sleeping Pills") is chosen, otherwise "null" is copied to the clipboard. It's as though after the first If statement is executed the {value} variable loses it's value or something, I don't get it... any thoughts? Thanks!