I was working on a game where I use the Y-variable to pre-determine the amount of rows in a matrix. I first store that value into Y and then I use Y to actually create the matrix.
This Y-variable is used in a few piecewise expressions, but nowhere where its value can be influenced. However, when I was testing the game, it crashed. This program is one I have been working on for the past couple of months, but this is the first time I got an "invalid dim" error (the kind of error is besides the point though), so, because the program had stopped because of the error, I checked all the traces my program had left: the matrix, the variables used and the graph screen where it was being displayed.
I ran through the code, used the traces to find the point where the code had crashed, but couldn't find the bug in the code, since it had been working all along. I re-checked my variables and noticed that the Y variable, which was meant to be 6, that had been used to create my matrix at the start of the game loop like I mentioned, was 0 instead, which made the piecewise expressions not do what I wanted them to.
So I downloaded the code to my computer, opened it in TI Connect CE and copy-pasted it into a Word document so I could use Ctrl + F to find where Y was used. Like I expected it was only used once to determine the matrix's dimensions (which actually happened, because the matrix's rows were in fact 6, so up until that point Y was still 6) and furthermore only in 3 piecewise expressions, so nothing could have influenced its value.
Finally, I thought I had accidentally reset the Y value by moving the cursor on the graph screen, but when I checked X, which should've gotten influenced too then, it was still the value I assigned it inside the program (27.083 to be exact). To make sure, I actually moved the cursor on the graph screen and now X got reset, which means that Y being 0 couldn't have been caused by me moving the cursor.
So I ask you people, what can influence Y that I don't know about? The only thing in my code which I don't know its functioning of is StorePic and RecallPic, but I doubt that's the cause.