Copy link to clipboard
Copied
I am not a correct output for the following script:
Never mind I found the bug: the statement should be changed to
"else if((storeys == "Two storeys") && (floor == "2nd"))
event.value = "1"
Thank you for putting me in the right track.
Copy link to clipboard
Copied
When you're assigning values to variables, you should use a single equal sign (=
) instead of a double equal sign (==
).
Why so many variables in this line: var zero, oneStorey, twoStoreys, none, B, M, S;
You don't use 'zero' or 'none' variable at all, you are setting floor variable to 'M' , 'B' or 'S' variable, but you didn't assign anything to them.
Copy link to clipboard
Copied
Also, your use of the switch command doesn't make sense. Why not simply use if-else if?
Copy link to clipboard
Copied
Because the switch statement I used is equivalent and simpler to in my script use than many "if" and "else" which could be confusing and there are too many combinations to deal with. Anyhow I tried that approach also and it does not work either. I am uploading the file for your own analysis.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Never mind I found the bug: the statement should be changed to
"else if((storeys == "Two storeys") && (floor == "2nd"))
event.value = "1"
Thank you for putting me in the right track.
Copy link to clipboard
Copied
Thank you, that was a huge improvement over my script.
However, the case "else if((storeys == "Two storeys") && (floor == "S"))
event.value = "1";" does not respond. Could you help?
Thank you
Copy link to clipboard
Copied
Copy link to clipboard
Copied
So it's working well, or not?