Yes!
But I have other things in mind: Look, let's say I have this code:
try
...
GetMem(p, 10000);
Object.SomeProcedure();
OtherObject.Procedure(10, 10);
open:= OpenSomething();
if open = FALSE then GoToExceptEnd;
...
except
FreeMem(p);
Object.Free;
OtherObject.Free;
CloseSomething();
end;
In this example, I have made calls to 4 procedures/functions: GetMem, SomeProcedure, Procedure and OpenSomething.
If something goes wrong with one of them, I have to free all the resources used by the code. I do that in the except/end statement.
But the problem is that the fourth function (OpenSomething) don't raise exceptions. Instead of this, it returns FALSE or TRUE. If it returns FALSE, I would like the code jump to the Except End to, as if an exception were raised.
Is there a way to do that?
Thank you!
Bookmarks