home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST0804.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-31  |  1.3 KB  |  45 lines

  1. Program OverlayDemoOne;
  2. { This simple do-nothing demo program is designed as an       }
  3. { introduction to adding overlays to a program.  Note that    }
  4. { the only requirement in the main program is that the        }
  5. { standard unit Overlay must be used in the main program      }
  6. { before any other unit that is overlayed.  Also note the     }
  7. { directives in the main program to actually overlay the      }
  8. { units.                                                      }
  9.  
  10. {$F+}
  11.  
  12. Uses
  13.   Crt, Overlay, OvrOne, OvrTwo, OvrThre;
  14.  
  15. { Instruct the compiler to overlay the following units:       }
  16.  
  17. {$O OvrOne}
  18. {$O OvrTwo}
  19. {$O OvrThre}
  20.  
  21. Var
  22.   Ch : Char;
  23.  
  24. Begin
  25.   ClrScr;                    { Clear the output screen.       }
  26.   OvrInit( 'MainProg.OVR' ); { Initialize the Overlay Manager }
  27.   If( OvrResult <> 0 ) Then  { Check for any error            }
  28.   Begin
  29.     Writeln( 'Overlay Error #', OvrResult );
  30.     Writeln( 'Program Halted' );
  31.     Halt( OvrResult );
  32.   End;
  33.   Writeln( 'This is a demo program that implements overlays.' );
  34.   Write( 'Press a key to call first overlay.' );
  35.   Ch := Readkey;
  36.   Writeln( Ch );
  37.   Writeln( 'Calling first Overlay Procedure....' );
  38.   Delay( 2500 );
  39.   Driver;
  40.   Proc2;
  41.   Writeln( 'Now back in main program.  Terminating....' );
  42.   Delay( 1000 );
  43. End.
  44.  
  45.