Qbasicnews.com

Full Version: Interesting result, need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have an array that spits out the height of a wall ray depending on how far away it is. At ray 297 it is 110.* at 1 square away. Now for some reason I kept getting an error, somehow the array is getting changed. This is the number that I had the program spit out during an error catch: 1.7663212e + 025. I used FBI's search to see if there was any place that the array had been manipulated, other than when it was actually built, no where. How can an array number get changed without the code for it, it seems to happen randomly.

Is is a bug in FB? maybe FB allows for two arrays to overlap in RAM or something? It only seemed to happen after I built an offscreen buffer.
Using pointers? Memory is probably being overwritten, FB arrays won't overlap, that can't happen.
No, I am not using any pointers anywhere in the program.
Can you post the code? I haven't been able to find any errors like that. You might be calculating the ray wrong or something, before you store it in the array...
I solved the problem, I still have no idea what caused it, but it had something to do with making a line on the buffer with a FOR loop. I had a whole bunch of checks to make sure that it never went out of range, but the problem was there, because as soon as I converted that to my vline function it stopped.