I am currently working on a project where I port Kylix Code to FPC.
Now, I have discovered a very strange thing...
( I have tested this only with Kylix - I am not sure about other Delphi Versions or loops...)
My FPC Project is configured as Linux-32bit with the regular Ansi Delphi Syntax for Kylix compatibility.
However a regular "for" loop counter behaves differently in Kylix than in Lazarus.
For exmaple (a simple loop):
for i := 1 to 6 do
begin
// some non critical operations
end;
ShowMessage (inttostr(i));
Kylix shows a value of 7 whereas FPC shows a value of 6 - at the end of the loop!
However, if you "BREAK" the loop in between (e.g. if i = 6 then break) - the value stays at 6 on both compilers.
So Kylix (for whatever reason) adds an extra value AFTER the loop has been SUCCESSFULLY finished.
This is a severe behavior throughout all loops in the project..
Could someone please give me any advice on how to solve/emulate this behavior in Lazarus, without much effort?
Is it possible to let the FPC developer know about this, so they may fix/emulate this?
Thank you so much in advance.