Could you tell me which version you tried this in? I tried it in Origin 6.1 SR4 (v.6.113) and experienced the problem in a slightly different manner. If I enter something like:
if (condition) {
// when condition is met (i.e. true), execute any script in here
}
else {
// when condition is not met, execute any script in here
}
the script would work when the condition was met, but wouldn't when it wasn't. However, if I entered:
if (condition) {
// when condition is met (i.e. true), execute any script in here
}
else
{
// when condition is not met, execute any script in here
}
the script would execute fine for both a true or false result. What this suggested is the placement of brackets for the if didn't matter, while the placement of the brackets in the else did.
Also, it would be helpful if you described the context of your situation and the steps you took which led to the problem. For instance, are you referring to the dialog obtained when selecting Tools : Worksheet Script? Or is it a different dialog? It would be great if you could clarify this.
- rtoomey