home *** CD-ROM | disk | FTP | other *** search
- Unit OvrOne;
- { This is actually the last unit in the overly chain. It is }
- { called from overlay number two. This routine is simply a }
- { demo of how to create an overlayed program. }
-
- {$O+,F+} { Instruct compiler this can be overlayed }
-
- Interface
-
- Uses Crt; { Link in the CRT unit for ClrScr call }
-
- Procedure Proc1;
-
- Procedure Proc2;
-
- Implementation
-
- Procedure IncWord( Var W : Word );
- { A simple support routine that will increment a word value }
- { passed. If the value is equal to MaxWord, then we will }
- { wrap the value back to zero. }
- Begin
- If( W = 65535 ) Then { Determine if value needs wrapped }
- W := 0
- Else
- Inc( W );
- End;
-
- Procedure Proc1;
- { THis procedure will prompt the user for a value and then }
- { increment this value by one. }
- Var
- W1 : Word; { Local variable to be entered }
-
- Begin
- Write( 'Enter a value (0-65535) : ' );
- Readln( W1 );
- IncWord( W1 );
- Writeln( 'After calling IncWord, value has become ', W1 );
- End;
-
- Procedure Proc2;
- { THis routine is simply an interface to the procedure listed }
- { above. It is included here as a demo of overlaying of }
- { procedures. }
- Begin
- ClrScr;
- Writeln( 'About to call Proc1.....' );
- Delay( 2500 );
- Proc1;
- End;
-
- End.
-