I'm using Win-64 2.0.12 of Lazarus. This is the first time I've used this version of the compiler and I believe the first time I've used the 64bit windows compiler.
I am having a very odd issue. I'm not sure if I'm doing something completely lame that I just don't see or if there is a compiler problem.
The gist of the problem is I want to process an exception inside a while loop and keep on processing more data:
while <cond> do begin
try
someprocedure; // this can generate an exception
except
<handle error>
end;
end;
The problem is, when the exception occurs, I never get to <handle error>, the program just stops.
If I move the try/except to enclose the entire loop, that exception is processed correctly but now the while loop has been terminated by the exception.
Enclosed is a simple test program that produces what I am seeing. Use {$undefine works} and it will compile the code with the try/except inside the loop - the code I want to have work.
In the {$undefined works} code, I would expect to see both 'failed', and 'after try' but neither are displayed.
Use {$define works} and it will compile code with the while loop enclosed by try/except. This works, but isn't what I need.
I have used exceptions often in the past, including my own. The only thing I can think I'm doing different than in the past is I'm testing the exception in the outblock, not a called procedure.
---------------------------------
Some additional information (added after initial post):
compiled the test program on another PC which is using 32bit Lazarus 2.0.10/FPC 3.2.0 and I am seeing the results I would expect:
after try
failed
after try
failed
...
The compiler with the problem is 64bit Lazarus 2.0.12 / FPC 3.2.0.
Same FPC compiler, different results. Is this a 64bit issue?