System: Windows 98SE, AMD K6, 124 MB RAM
Compiler/IDE: Borland Pascal 7.0 Protected Mode
Libraries: None

---

Hello all,

I've been working on a game for over a year now and am getting close to completion. However, I've run in to some serious problems. During programming in real mode I've had the game split in two separate programs, that have both functioned perfectly. Now I needed to join these two separate programs to one. I quickly discovered that combined, these two programs took up too much memory and wouldn't compile in real mode. So I switched to protected mode. After installing a new mouse unit that functioned in protected mode, I managed to compile the game, but I keep getting runtime errors, especially the 216 error. I really can't figure out what I'm doing wrong, especially since the two programs ran perfectly in protected mode when they were separate, but now when I'm calling these two programs (now just units) from the main game program, they don't work and crash.

I got some strange results from some of my arrays (the contents of the strings of the arrays would change when the game loop was running, even though nothing in the game loop should alter them!), but when I changed that particular array to a pointer that was allocated with New() and Dispose(), those strange results disappeared. So, I tried to change some other arrays that were behaving strangely, but then I couldn't get the program to run at all.

I'm dumbfounded as to what is causing these errors, as I'm pretty sure I'm allocating everything properly -- and both programs worked when running separately!

Any ideas what's going on? I'm just about to lose my mind here...

PS. The game is a console program using only ASCII 'graphics'.