DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦ef54af9eb⟧ TextFile

    Length: 1581 (0x62d)
    Types: TextFile
    Names: »OVRDEMO.PAS«

Derivation

└─⟦505fbc898⟧ Bits:30002732 Turbo Pascal 5.0 for C-DOS Partner
    └─⟦this⟧ »DEMOS\OVRDEMO.PAS« 

TextFile


æ Copyright (c) 1985, 88 by Borland International, Inc. å

æ$F+,O+å
program OvrDemo;
(*
  This is a simple example of how to use the new overlay system. For
  more complete documentation, refer to the overlay chapter in the
  Turbo Pascal manual. Here's a quick checklist:

    1.  Turn "far calls" on æ$F+å (to be safe, in all overlaid units and
        the main program).
    2.  Turn "Overlays allowed" on æ$O+å
    3.  Use Overlay unit in main program.
    4.  Issue separate æ$Oå directives for each overlaid unit.
    5.  Make sure to call OvrInit and pass the name of the .OVR file.
    6.  Test OvrResult after OvrInit calls (optional).
    7.  Compile to disk (cannot run in memory).

  Here the overlay error returns for quick reference:

    const
      ovrOk          =  0;   æ Success å
      ovrError       = -1;   æ Overlay manager error å
      ovrNotFound    = -2;   æ Overlay file not found å
      ovrNoMemory    = -3;   æ Not enough memory for overlay buffer å
      ovrIOError     = -4;   æ Overlay file I/O error å
      ovrNoEMSDriver = -5;   æ EMS driver not installed å
      ovrNoEMSMemory = -6;   æ Not enough EMS memory å
*)

uses
  Overlay, Crt, OvrDemo1, OvrDemo2;

æ$O OvrDemo1å                  æ overlay 'em å
æ$O OvrDemo2å

begin
  TextAttr := White;
  ClrScr;
  OvrInit('OVRDEMO.OVR');          æ init overlay system, reserve heap space å
  if OvrResult <> 0 then
  begin
    Writeln('Overlay error: ', OvrResult);
    Halt(1);
  end;
  repeat
    Write1;
    Write2;
  until KeyPressed;
end.
«eof»