My stack of many hundreds of hours work was working just fine, then a script error has popped up that I can't make sense of. The error message is "compilation error at line <number> (Chunk: can't create a variable with that name..." (see attached)
If I comment out that line the error goes to the next perfectly good line of code.
If I comment out the entire handler the error goes to the first perfectly good line of the next perfectly good handler.
If I comment out the entire 2700+ lines of code in the stack script except for the "on" and "end" lines of the handler and a single line of code the error is still there on that single line of code. If I swap out the process with another line of code in that handler the error is still there.
I have no idea how to solve this. Is it corruption?
Bruce
Baffling script error
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Baffling script error
Looks like you’re using strict compilation?
If that’s the case then you’re either using an undeclared variable or there is a typo in a variable name….
If that’s the case then you’re either using an undeclared variable or there is a typo in a variable name….
Re: Baffling script error
Well, that's a bit embarrassing. I had gotten into the habit of not declaring local variables because Livecode allows that when Strict Compilation--which I knew nothing about--is not chosen in Preferences. It's a mystery how that got checked, but hey, there are plenty of mysteries in life. Thanks for your help, Stam!
Re: Baffling script error
No worries, we all done itbd525 wrote: ↑Sun Mar 05, 2023 10:00 pmWell, that's a bit embarrassing. I had gotten into the habit of not declaring local variables because Livecode allows that when Strict Compilation--which I knew nothing about--is not chosen in Preferences. It's a mystery how that got checked, but hey, there are plenty of mysteries in life. Thanks for your help, Stam!
Personally I prefer to use strict compilation because it picks up typos that can make things fail silently (I have an annoying habit that while I touch-type my right had is just quicker than the left so letters not infrequently are inverted - strict compilation picks these up for me and saves me personally a lot of headache - but each to his own )