Code: Select all
Procedure.i Test(value.i)
For counter.b = 0 To 10
value + counter
Next
Debug counter
ProcedureReturn value
EndProcedure
Debug Test(2)
Now what I would like is the For to automatically declare the variable to be local just to the For loop, so trying to access counter outside of the loop would go boom:
Code: Select all
EnableExplicit
Procedure.i Test(value.i)
For counter.b = 0 To 10 ; <-- No boom
value + counter ; <-- No boom
Next
Debug counter ; <-- BOOM!
ProcedureReturn value
EndProcedure
Debug Test(2)