[fpc-pascal]CTRL + Break

dirk at verwiebe.de dirk at verwiebe.de
Fri Jul 20 14:22:50 CEST 2001


Antwort auf Mail von Lee, John vom 20.07.2001 10:59:31:


Hi John,

thank you for your hint.

Catching CTRL+Break now works.
I modified your program a little bit.

regards 

Dirk Verwiebe

>program tst;
>
>uses ctrl_c;

should be. 
uses dpmiexcp;

>
>var  NewSignal,OldSigSegm,OldSigInt : SignalHandler;
>Function CatchSignal(Sig : longint):longint;
>begin
>  case Sig of
>   SIGSEGV : begin
>             { Temporary message - until we get an error number... }
>               writeln ('Panic : Internal compiler error, exiting.');
>               Halt(99);
>             end;
>    SIGINT : begin
>              WriteLn('Ctrl-C Signaled!');
>              Halt(1);
>             end;
>  end;
>  CatchSignal:=0;
>end;
>
>begin

These lines are missing.

NewSignal:=SignalHandler(@CatchSignal);
OldSigInt:=Signal (SIGINT,NewSignal);

>{must be doing i/o otherwise ctrl/c does not work}
> repeat write('.'); until false;
>end.



More information about the fpc-pascal mailing list