A variable is a named, temporary location in the computer's memory where data is stored. A variable must have a data type, such as long, float, char, word, short, string, or variant. The data type signifies:
Size of the data stored in the variable.
Interpretation of the data stored in the variable.
Type of operation performed on the data in the variable.
You can create and use variables in the Program, System, and Driver modules, and within a Procedure or Event or a Form.
By default, variables are non-public or local. Non-public or local means that a variable defined in one module is not visible from another module. Hiding variables from another module is generally a good programming practice because code from one module is not able to change the variable values defined in another module.
A variable can be used in several ways when you are writing code. Variables can be used in:
An assignment statement where you assign a value to a variable and change its value.
For example: nStatus=3
where the value 3 is assigned to the variable nStatus.
An expression where a variable value is used to calculate another value.
For example: '3*lValue+5'
As a parameter to a procedure or a function.
For example: 'tan(dValue)'
where the function tan calculates the parameter dValue.