If I compile and run my example program and then press Crtl+C the program terminates. I would expect that it terminate by calling "CloseServer" procedure, but it dos not. If the program terminates normally (time runs out) the "CloseServer" procedure is called as expected.
Have I misunderstood something about the ExitProc.
Regards Carsten
program exitp;
Uses sysutils; {System}
var
ExitProcGem:pointer;
Procedure CloseServer;
Begin
ExitProc:=ExitProcGem;
WriteLn('Server closed.');
End;
begin
ExitProcGem:=ExitProc;
;
sleep(10000);
WriteLn('--Close--');
end.