in reply to Declare Variable in Loop
state variables actually fit the bill. The downside is that they are never implicitly cleared. A non-obvious side-effect is that it makes the code non-reentrant.
Note that using them in this circumstance will have the maintainers scratching their head.
Note that state doesn't fulfill your newly stated goal as it actually increases the scope of the variables to future calls of the same block.
Update: Added last para in response to new information.
|
|---|