home *** CD-ROM | disk | FTP | other *** search
- PROGRAM TestBrk;
- {Test program for BREAK.PAS UNIT}
- USES
- Break, CRT;
- VAR
- Count, Attempts : Word;
- BEGIN
- ClrScr;
- TrapCtrlBrkOn; {Start Ctrl-Break trapping}
- GotoXY(26,12);
- Write('# of Ctrl-Break attempts = ');
- GotoXY(33,13);
- Write('Count = ');
- {Allow 5 Ctrl-Break attempts before continuing}
- WHILE Attempts < 5 DO
- BEGIN
- IF BrkTrapped THEN
- BEGIN
- Inc(Attempts);
- GotoXY(53,12);
- WriteLn(Attempts:2);
- BrkTrapped := FALSE
- END;
- Inc(Count);
- GotoXY(40,13);
- WriteLn(Count:6)
- END;
- TrapCtrlBrkOff; {Normal Ctrl-Break processing}
- GotoXY(26,16);
- WriteLn('Now you may break out of me!');
- Count := 0;
- GotoXY(33,18);
- Write('Count = ');
- WHILE TRUE DO
- BEGIN {Infinite loop}
- Inc(Count);
- GotoXY(40,18);
- WriteLn(Count:6)
- END
- END.
-
-