[fpc-pascal] Catching Exceptions in Library

Steve Gatenby steveg at nevets.com.au
Fri Nov 7 01:39:00 CET 2014


Could anybody tell me why the following error is caught by the try 
except in an Application, but not in a Library ?

I am needing to find out where try except doesn't do what I think, not 
fix this code.

  this is a contrived error to show the problem, not part of my code :)

procedure Test();
var
   Ctrl    :TObject;
begin
   try
     Ctrl  := TObject(12345);
     sStr1 := Ctrl.ClassName;
   except
     writeln('Caught Exception');
   end;
end;

Thanks - SteveG



More information about the fpc-pascal mailing list