Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

mystery if then else error in script

Hello,

I'm having trouble with if/then/else in a script. I had this working in a different document, but I get script errors now. The exact script below throws the error. If I comment out the If/Endif statement, it runs fine. What am I missing (I know it's something painfully obvious, but I've been searching Google and the forums for ~60 mins with no luck).

Once I solve the "outer" if/then, I need to work on the inner if/then, but one thing at a time!

ifscripterror.gif

Thanks!

10 Replies
Not applicable
Author

Well..... I continued having script gremlins. The debugger and the "normal" reload would intermittently throw "script error: endif" errors. I eventually made this go away by changing to a switch on a boolean:

solved.gif

I think the compiler must do some crazy partial evaluation behind the scenes... hence the sporadic errors with the prior syntax.