home *** CD-ROM | disk | FTP | other *** search
- Program OverlayDemoOne;
- { This simple do-nothing demo program is designed as an }
- { introduction to adding overlays to a program. Note that }
- { the only requirement in the main program is that the }
- { standard unit Overlay must be used in the main program }
- { before any other unit that is overlayed. Also note the }
- { directives in the main program to actually overlay the }
- { units. }
-
- {$F+}
-
- Uses
- Crt, Overlay, OvrOne, OvrTwo, OvrThre;
-
- { Instruct the compiler to overlay the following units: }
-
- {$O OvrOne}
- {$O OvrTwo}
- {$O OvrThre}
-
- Var
- Ch : Char;
-
- Begin
- ClrScr; { Clear the output screen. }
- OvrInit( 'MainProg.OVR' ); { Initialize the Overlay Manager }
- If( OvrResult <> 0 ) Then { Check for any error }
- Begin
- Writeln( 'Overlay Error #', OvrResult );
- Writeln( 'Program Halted' );
- Halt( OvrResult );
- End;
- Writeln( 'This is a demo program that implements overlays.' );
- Write( 'Press a key to call first overlay.' );
- Ch := Readkey;
- Writeln( Ch );
- Writeln( 'Calling first Overlay Procedure....' );
- Delay( 2500 );
- Driver;
- Proc2;
- Writeln( 'Now back in main program. Terminating....' );
- Delay( 1000 );
- End.
-