DelphiBasics
ErrorAddr
Variable
Sets the error address when an application terminates System unit
var ErrorAddr : Pointer;
Description
The ErrorAddr variable is set to the address of an error when an application termination condition is reached. The value is displayed in an error dialog.
 
Delphi itself also stores the address of a code error when a run time error is encountered.
Related commands
AddrGives the address of a variable, function or procedure
ErrorAddrSets the error address when an application terminates
ExitExit abruptly from a function or procedure
 Download this web site as a Windows program.




 
Example code : Display an error address in a termination error dialog
var
  i : Integer;
begin
  // Set up an error address so that halt shows a termination dialog
  ErrorAddr := Addr(i);

  // Set the program exit code
  ExitCode := 8;
end;
Show full unit code
  When the program terminates, an error dialog is displayed:
  
  Runtime error 8 at 0069FC94
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page