Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!shlump.nac.dec.com!decwin.enet.dec.com!granoff From: granoff@decwin.enet.dec.com (Mark H. Granoff) Newsgroups: comp.lang.pascal Subject: Turbo Pascal 5.5 and Overlays Keywords: turbo pascal 5.5 overlays units Message-ID: <6458@shlump.nac.dec.com> Date: 29 Nov 89 20:39:30 GMT Sender: newsdaemon@shlump.nac.dec.com Reply-To: granoff@decwin.enet.dec.com (Mark H. Granoff) Organization: Digital Equipment Corporation Lines: 54 I have a large application, which is only about half done, and is getting larger. Since memory is at a premium, I've decided that the only (?) solution is to use overlays. Fortunately, related functions and procedures are already separated into various include files. So, converting these large chunks of code into overlayable units should not be difficult. Here's the problem. I decided to check out this overlay business with a little test program (included after this text, from memory). The problem is that when I run the .EXE, I get a runtime error 208 (which means that I haven't init'd the Overlay manager). This doesn't make sense though because the error occurs at the BEGIN for the main program, before the program would have had a *chance* to init the overlay manager! What am I missing? Thanks. OVRUNIT.PAS UNIT ovrunit; {$O+,F+} INTERFACE procedure ovrjunk; IMPLEMENTATION procdure ovrjunk; begin writeln('procedure ovrjunk called.'); end; BEGIN END. I compile this and get a .TPU file, as expected. OVRTEST.PAS PROGRAM ovrtest; {$F+} USES Overlay,ovrunit; {$O ovrunit} BEGIN { <------- Run time error occurs here!? } OvrInit('ovrtest.ovr'); { examine OvrResult here as appropriate...} ovrjunk; { call procedure in overlay } END. I compile this and get .EXE and .OVR files, as expected. When I run OVRTEST, I get Runtime error 208. Could it be that I since I have only one unit overlayed, the overlay manager is getting confused or something? I probably missed something obvious... Thanks for your help, and be kind. :-) Please respond directly to me, since I don't get to read this group very often, at granoff@decwin.dec.com --or-- granoff@vaxwrk.dec.com. -Mark