home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
pascal
/
tplib21.zip
/
INSTALL.EXE
/
EXCRTCL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-30
|
1KB
|
46 lines
(* Example program: CRTCLERR unit *)
PROGRAM EXCRTCL;
USES
CRTCLERR;
VAR
f: TEXT;
i: INTEGER;
BEGIN
WriteLn('EXCRTCL - CRTCLERR UNIT EXAMPLE PROGRAM');
WriteLn;
WriteLn('Turbo Pascal replaces the operating system''s critical-error');
WriteLn('handler with its own. For this demonstration we will generate');
WriteLn('a critical error by attempting to access a diskette that is not');
WriteLn('present. Please ensure that no diskette is in drive A, then');
WriteLn('press RETURN...');
ReadLn;
CriticalErrorTP;
Assign(f,'A:NOFILE.$$$');
WriteLn;
WriteLn('Now attempting to access drive...');
{$I-}
Reset(f);
i:=IOResult;
WriteLn('Turbo Pascal has returned an IO error of ',i);
WriteLn;
Write('Press RETURN to continue...');
ReadLn;
WriteLn;
CriticalErrorDOS;
WriteLn('With the DOS error handler restored, you will be presented');
WriteLn('with the usual "Abort, Retry, Ignore?" prompt when such an');
WriteLn('error occurs. (Later DOS versions allow a "Fail" option.)');
WriteLn('Run this program several times and try different responses.');
Write('Press RETURN to continue...');
ReadLn;
WriteLn('Now attempting to access drive again...');
Reset(f);
i:=IOResult;
WriteLn('Turbo Pascal has returned an IO error of ',i);
END.