Declaring Variables
Declaring a single variables
Declaring Multiple variables
Declaring a single variables
We can declare variables using Dim statement or public statement or private statement
Example:
Dim Variable1
public Variable2
private Variable3
Declaring Multiple variables
We can declare multiple variables by separating each variable name with a comma.
Example:
Dim Coordx, Coordy, Coordz
Standard Rules for Variable Names
- Must begin with an alphabetic character (A...Z,a...z) or an underscore character
- Cannot contain an embedded period
- Must not exceed 255 characters
- Must be unique in the scope in which it is declared.
- After the first character, variable can contain letters, digits and underscore
Assigning value to Variables
Variable1 = 10
Variable Constants
We can create variable constants using const keyword.
Const Pi = 3.14
Array VariablesAn array variables is used to store multiple values in a single variable.
Dim VehicleName(2)
VehicleName(0) = "Volvo"
VehicleName(1) = "Santro"
VehicleName(2) = "Mahindra"
No comments:
Post a Comment