Follow this suggested format for naming variables.
Syntax
[Scope]TypeName
Arguments
Scope
Optional. A convention for noting the range of reference for the variable. For example, local variables can be prefixed with "l," which reminds you that they can referenced only within the procedure they were defined in. Suggested expressions for Scope are as follows.
Scope | Description | Example |
l | Local |
|
p | Private (default) |
|
g | Public (global) |
|
t | Parameter |
|
Type
Convention for noting the data type of a variable. Suggested prefixes for Type are as follows.
Type | Description | Example |
a | Array |
|
c | Character |
|
y | Currency |
|
d | Date |
|
t | Datetime |
|
b | Double |
|
f | Float |
|
l | Logical |
|
n | Numeric |
|
o | Object |
|
u | Unknown |
|
Remarks
Prefixes aren't required, but are recommended as good programming practice. Using a prefix does not dictate the value of a variable — in Visual FoxPro, prefixes are used only as a naming convention. For example, adding the prefix "c" does not check that only character data is stored to the variable, but it does help you remember that the variable was created to accept character data.
Note The scope prefix is recommended but not required. In some cases, explicit scoping does not apply. For example, in the main program of a stand-alone application, there is no difference in visibility for variables scoped as PUBLIC or PRIVATE. The type prefix is always relevant and is required in sample programs.
For more information, see Visual FoxPro Naming Rules.