![]() |
|
|
Manipulating Strings and Integers There are many small things that can be done to data types (integers, strings...) in VB that make the life of the programmer much easier. In this section, I'll discuss the most important and the most widely used techniques for manipulating numbers and characters. Here is an index of what will be discussed in this lesson: Converting Data Types Constants Dates and Times Using the Format Function Manipulating Text Strings
Constants Basically, constants are like variables in the sense that they take up storage space in memory and store data within them. However, Visual Basic uses constants more efficiently than normal variables. Constants contain values that don't change whatsoever throughout the program. An example would be the PI function in mathematics which is a "constant" (3.14). Constants are declared just like normal variables: Private/Public Const constant_name [As type] Here is an example:
Const PI As Double = 3.14 The variable PI is declared as a constant. That's the only difference! |