
Chapter 15
VARIABLES AND OPER ATORS IN
VISUAL BASIC
15.1 VARIABLE NAMING CONVENTIONS
1. Must begin with a character.
2. Maximum length of variable is 255 characters.
3. Should not contain spaces or special characters except the underscore (_).
15.2 VARIABLE DECLARATION
To declare the variable private use DIM
DIM < variable name > as < Data Type >
For example, DIM productname as String
DIM quantity as Integer
To declare the variable public use PUBLIC
PUBLIC < variable name > as < Data Type >
297