[fpc-devel] Declare variables inside the code

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed May 11 12:07:31 CEST 2011


kingbizugo at gmail.com schrieb:

> I would like to be able this:
> [ some code after begin ]
> DoSomething;
> var I: Integer;
> for I := 0 to 1000 do
> DoAnotherThing(I);
> [ inside the code ]

That's not good practice, in no programming language.

Better move the loop into a local procedure, where you can declare 
really local variables.

DoDi




More information about the fpc-devel mailing list