May 1999
Intermediate to advanced
1440 pages
38h 6m
English
Variables are defined as placeholders for nonstatic information. When you need a placeholder for static information, create it as a constant. Constants are used for two reasons. One reason is to hold a value referenced numerous times that does not change during the run of the program but may change in the future—for example, a tax rate. Another reason is to make a program more readable. For example, TaxRate is easier to read than .08167.
To declare a constant and set its value, use the Const statement. After a constant has been declared, it cannot be assigned a new value. If you wanted to declare, for example, a constant to store the value of a sales tax, you would use the following statement:
Const SALESTAX As Long = .06231 ...
Read now
Unlock full access