procedure ShowExceptionMessage;
Shows the message associated with the current exception in a message box. This function should only be called from within an except section, or a function called from an except section.
If logging is enabled (via the /LOG command line parameter or the SetupLogging [Setup] section directive or the UninstallLogging [Setup] section directive or debugging from the Compiler IDE) the message will be recorded in the log file and/or in the Compiler IDE's "Debug Output" view in addition to being shown.
var
I: Integer;
begin
I := 1;
try
// The following line will raise a "Division by zero" exception
I := I div 0;
except
// Catch the exception, show it, and continue
ShowExceptionMessage;
end;
end;