Saturday, February 27, 2016

VARIABLE DECLARATIONS

VARIABLE DECLARATIONS
The complete syntax for a variable declaration is as follows:
[attribute_list] [accessibility] [Shared] [Shadows] [ReadOnly]
Dim [WithEvents] name [(bounds_list)] [As [New] type]
[= initialization_expression]
All declarations have only one thing in common: They contain a variable’s name. Other than the
name, different declarations may have nothing in common. Variable declarations with different
forms can use or omit any other piece of the general declaration syntax. For example, the following
two declarations don’t share a single keyword:
Dim i = 1 ‘ Declare private Integer named i. (Option Explicit Off)
Public j As Integer ‘ Declare public Integer named j.
The many variations supported by a variable declaration make the general syntax rather
intimidating. In most cases, however, declarations are straightforward. The previous two
declarations are fairly easy to understand.

No comments:

Post a Comment