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

Re: New warning from compiler about loop variables


On 9/28/26 6:47 PM, Brian G wrote:
I have discovered that many many of my loop variables are duplicated

I think there was a while where the code editor was adding a definition

when you used the variable.. must be because i don't think i used a dim in most cases of a loop

and there it was right at the top of the function...

Does anyone else remember this happening?


Not sure what you mean by, "a while", as if the editor stopped doing that. To my recollection, it has been doing that for some time now.

If you do:
  For x = 1 To 10
    ' do something
  Next
and 'x' has not been previously declared, the editor will add the declaration.

If you do:
  For x As Integer = 1 To 10
    ' do something
  Next
the editor will not add the declaration.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: New warning from compiler about loop variablesBB <adamnt42@xxxxxxxxx>
References:
New warning from compiler about loop variablesBrian G <brian@xxxxxxxxxxxxxxxx>