mm wrote:
Zaher Dirkey a écrit :
I hate exit when i try to improve a procedure
some code
if (b) then
exit;
some code
for long procedures i cant notice exit here and add some resource or
memory uses
AnObject := TAnObject.Create;
try
some code
if (b) then
exit;
some code
finally
AnObject.Free;
end;
Now Exit leave the procedure without freeing "AnObject".
We need a new Exit keyword to jump to Finally section (I do not think
Abort is useful here).
But AnObject is freed. If ever Exit had the behaviour you describe, we
would have a big problem.
True, the object is freed and the procedure exited. Now it would be nice
to jump to the finally clause and continue in the procedure. Sigh,
wishfull thinking.
Andreas
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal