Hi,

20.02.2019 18:24, Dimitrios Chr. Ioannidis via fpc-devel:
[...]
 I'd like to see an example how this is less safe.

Well one of the answer in the Cantu blog has this ( which I changed to
lets say a "real world" relative big function ) :

How this example is different from e.g. using normally declared "I, J: Integer" and employing "J" as a loop variable? Wouldn't it do the same error anyway?


Thank you,

Regards,
Nikolai

var arr: array...

function Fuckup: boolean;
var I: Integer;
begin



    <....>  20 lines of code



   for var I := Low(arr) to High(arr) do
     if arr[I]..... then
       break;



   <....>  20 lines of code



   Result := (I<= High(arr));
end;

regards,
--
Dimitrios Chr. Ioannidis



_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to