"caius tenche" <caius.tenche@canrem.uucp> (05/06/91)
MP>I need to get my programs, written in Tp5.5, to execute a procedure
MP>or flag a variable/address when a run-time error occurs, instead
MP>of exiting the program with an error.
If, you would like a procedure to be executed when an unexpected (as
opposed to the expected kind) run-time error occurs, take a look at the
ExitProc variable.
ExitProc is a pointer variable that points to an exit procedure. What you
need to do is write your own exit procedure and point ExitProc to it.
For example.
Var
ExitSave : pointer (* declare this global variable to *)
(* save the original vector *)
procedure MyExitRoutine;
begin
{
Here you can insert whatever code you like
}
ErrorAddress := Ptr (0, 0); (* ErrorAddress is an predefined TP *)
(* redirect it to nowhere *)
end;
begin
ExitSave := ExitProc (* save the original exit vector *)
ExitProc := @MyExitRoutine; (* point it to you exit routine *)
{
stick in filler stuff here
}
ExitProc := ExitSave; (* just before quiting to DOS, *)
(* restore the original vector. *)
end.
Try the code above. I'm doing this from memory, and I might have given you
the wrong name for the ErrorAddress variable; check you TP manual on this
one. Good luck.
Ttyl, Caius
UUCP: lsuc!canrem!caius.tenche
InterNet: caius.tenche%canrem@lsuc.on.ca
---
? DeLuxe? 1.1 #7470 ? Only use Bat chutes in a real emergency.
--
Canada Remote Systems. Toronto, Ontario
NorthAmeriNet Host