SRL Archive - Bugs

Error in try- statement


Chris

2013-02-12 11:16:14

A picture is worth a thousand words:


This must be a bug, right?
Or shouln't try-except-finally catch all exceptions?

Neodymium

2013-02-13 08:30:17

I'm not 100% sure about Pascal, but I do know that in Java you need to catch the exceptions.
In that case, you would have a try-catch-finally.

Chris

2013-02-14 04:57:42

This is what I first wrote: "In Pascal, that's try-except-finally. But afaik, try-finally should do nothing with errors, but always continue with the code.", though when I tried this:
program new;
var
i: TIntegerArray;
begin
try
i[2] := 1;
except

finally
end;
end.

And tried it without the "except", it appears that you're right!
Thanks, rep++ :)