Variables, constants, and procedures all have names. The section of a project where these names are known is called the scope of the name. Attempts to access a name outside its scope results in an "Undefined symbol" error because a valid name cannot be found by the compiler.
In general, a name is known within the block where it is declared, and within any blocks contained in the block where it is declared. For example, a variable declared in a procedure is known only in that procedure, but a variable declared in a module is known in all procedures contained in that module.
To access a name from outside the block where it is declared, the name must be declared as Public. Public names can be accessed from anywhere, provided that the path to the name is fully specified. As a special case, Public module-level names may be accessed without the module name being specified, provided that the name is unambiguous in all modules.
For example:
Module MyMod
Public ModVar As Integer
Public Class My_class
Public Shared MaxSize As Integer
Private Shared Size2 As Integer
End Class
End Module
Module GPL
Public Sub Main
My_class.MaxSize = 100 ' Invalid, path not complete
MyMod.My_class.MaxSize = 100 ' Okay
MyMod.My_class.Size2 = 100 ' Invalid, private variable
ModVar = 20 ' Okay, special case
End Sub
End Module