Visual Studio Code Editor
I get a '...not declared' syntax error after the initial variable
declaration in any other subs or functions. Dim has module level scope so
any subs or functions in the class should recognize iAnything. Why the
syntax errors?
For example:
Class aclass...
Private Sub blabla
dim iAnything as Integer
iAnything = 5 'ok
End Sub
Private Sub AnotherSub
Dim oSomething as Integer
oSomething = iAnything 'syntax error - iAnything not declared
End Sub
Function Afn(ByVal...)As Atype
Dim oSomething as Integer
oSomething = iAnything 'syntax error - iAnything not declared
End Function
End Class