Jump to content

Compiler error


kert349

Recommended Posts

Is this a dialog result script? You don't want to be defining variables there at all.

why not?

 

does the ref fail at runtime?

Because their scope is extremely limited. Result scripts only "live" for one iteration and when that's complete those variables are destroyed. So if you assign a value to a local variable, if that script runs again (like if that dialog option is triggered again) the previous value is not maintained. Meaning the usefulness of local variables in result scripts is also extremely limited. The only cases I can think of would be if you need a single variable or variable type as a parameter or to call a particular function. But those cases would be rare, and I think usually could be done in better, more efficient ways anyway.

 

You may notice that above, I more or less said that what you were trying to do with:

 

set self.changePackages to 2

...WOULD have been one of those acceptable cases, IF a variable was allowed in that syntax. But it is not, and if anyone is still paying attention, that's the answer to your original question of why your script doesn't work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...