Skip to content

Instantly share code, notes, and snippets.

@emoacht
Last active August 29, 2015 14:20
Show Gist options
  • Save emoacht/9c76f15454091f55a66c to your computer and use it in GitHub Desktop.
Save emoacht/9c76f15454091f55a66c to your computer and use it in GitHub Desktop.
Scope of a local variable in loop (Case 4)
Private Sub LocalVariableCase4A()
For i = 0 To 2
LocalVariableCase4B()
Next
'False
'False
'False
End Sub
Private Sub LocalVariableCase4B()
Dim value As Boolean
Console.WriteLine(value) 'No error in VB
value = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment