Name Resolved Error Before Variable is Assigned/Used
Jan 7, 2020 6:41 AM(538 views)
I have a script whose basic structure is:
generate a few lists that feed the user interface
create user interface
take user input
I wrote the script using expressions and everything beyond creating the user interface is only called to be run after the user presses the OK button on the user interface
The user must select a time range for the analysis which I then import and use as a variable called "days" during the analysis. The only time this variable is defined and used is in the expression to get the user's input to feed into doing the analysis, however when I run the script it will create the user interface and then give a Name Unresolved alert for the days variable even before anything is input by the user. After closing the alert window and entering choices into the user interface the script does seem to run correctly.
The variable is defined and then used in a calculation. The alert is happening on the line that uses the variable not the section that defines it. I've dealt with Name Unresolved issues before, but I can't tell why it's popping up before the expression hasn't been called.
Thanks! Putting the further code inside the button is just what I was going for. Turns out there was another issue later on in the script that I didn't catch before and was making things more complicated.