I came back to a project after being away from it for many months. For a bit of context sometimes I might be developing in Classic other times Studio (Oh how I wish the Studio editor had the same configurability as Geany) with the same source code.
So I open the project in the Studio IDE and after fixing some issues, find that when Run as Debug, the program works as it should. But with a normal Run, it would produce a runtime error in a part of the code that I know is good. No matter what I tried, Debug worked without error, Run would not. And the line of code that was reported for the runtime error didn't really make much sense. It was a divide by zero, but I was sure the variable was non-zero because when stepping through with the Debugger it was fine.
After a lot of commenting out code to narrow down the cause without success, I looked in the folder:
C:\Users\susan\AppData\Local\AGKApps\mytestapp\media\
And saw a file named:
bytecode.byc
with a date much earlier than today. So I delete that file and Run the code again, and it works fine. Yay. (And there isn't a new bytecode.byc created in the folder.)
For some reason, the IDE would Run this old bytecode, without first refreshing it. And what seems weird, is that now there is never a new bytecode.byc created in that folder. If the Studio IDE doesn't need that file, and seems to be working fine without it, why did the bytecode.byc file exist, and why was the IDE referencing it now? (if it is important, shouldn't it update the file before running?)
I mention this story in case it saves a bit of time (it took me over two hours to figure out what was going wrong) for someone else who comes across an error message that doesn't make sense.