Okay, I am pretty sure I have a memory leak. When I play the game, each time it loads a new level, I can see the memory going down to a certain point, then it builds back up as the level gets loaded.

However, each time it does this, it drops down to a point slightly higher than the last time, so each level starts to use up more and more memory. Once it reaches a certain level, the crashes and errors start occurring.

This strange variable bug is just one of a few bugs that occur, but it is the one that occurs most often, so I thought I would deal with it first. However, now I can see that it just depends on what the game is doing once the memory reaches that high level.

@Reconnoiter - is error(myValueString) an A8 feature? I have A7 and the manual does not mention anything about it...

The text file does not show the strange numbers. It's happening when the function reaches the end of the file, so it should return 0 and end the function. This works fine, until, as I've found out, the memory use gets too high.

I will search for memory leaks here on the forum. If anyone knows about finding/detecting/isolating them, please let me know where to look.