[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New warning from compiler about loop variables


> For X as Integer = 1 to 12 ' X is declared as a *new Integer local to the loop*
> 	do something
> Next
> Print X ' Prints 123
>
>
 I don't think so... At least the memory address do not change and thus
what would be the issue?

Dim n As Integer
Print "initial; ";; VarPtr(n)

For n As Integer = 0 To 0
Print "inside; ";; VarPtr(n)
Next

Print "at the end; ";; VarPtr(n)


Jussi

>

Follow-Ups:
Re: New warning from compiler about loop variablesbrian <brian@xxxxxxxxxxxxxxxx>
References:
New warning from compiler about loop variablesBrian G <brian@xxxxxxxxxxxxxxxx>
Re: New warning from compiler about loop variablesLee <t.lee.davidson@xxxxxxxxx>
Re: New warning from compiler about loop variablesBB <adamnt42@xxxxxxxxx>