This appendix provides information about variable declarations and data types.
The following code shows a standard variable declaration:
accessibility] [Shared] [Shadows] [ReadOnly] _ Dim [WithEvents]
bounds_list)] [As [New]
type[?]] _ [=
The following list describes the pieces of this declaration:
attribute_list — A comma-separated list of attributes specific to a particular task. For example,
accessibility — Public, Protected, Friend, Protected Friend, Private, or Static.
Shared — Means that all instances of the class or structure containing the variable share the same variable.
Shadows — Indicates that the variable hides a variable with the same name in a base class.
ReadOnly — Indicates that the program can read, but not modify, the variable's value. You can set the value in an initialization statement or in an object constructor.
Dim — Officially tells Visual Basic that you want to create a variable. You can omit the Dim keyword if you specify Public, Protected, Friend, Protected Friend, Private, Static, or ReadOnly.
WithEvents — Tells Visual Basic that the variable is of a specific object type that may raise events that you will want to catch.
name — Gives the name of the variable.