Variable Declaration
| Visual FoxPro 9.0 SP2 |
| Variable Declaration (Visual FoxPro) |
| See Also |
|
You can compare how variable declaration differs between Visual FoxPro and other programming languages. In Visual FoxPro, you do not assign a data type to a variable. However, it is recommended that you name your variable with a prefix suggesting the data type you plan to use it with. Other languages require that you assign a data type to a variable when you declare it. For more information, see Variable Naming Conventions.
Note |
|---|
|
When you store a value to a variable and the variable does not exist, Visual FoxPro implicitly declares it with PRIVATE scope. Other languages that require explicit declaration of variables return an error. To create variables in Visual FoxPro with PUBLIC or LOCAL scope, you must explicitly declare them with the PUBLIC or LOCAL command. For more information, see PUBLIC Command and LOCAL Command. |
| Visual FoxPro | BASIC |
|---|---|
|
Variables are implicitly declared with no data typing. |
Variables can be implicitly declared, and the variable name dictates data type. |
| Pascal | C/C++ |
|---|---|
|
Variables must be explicitly declared and assigned a data type. |
Variables must be explicitly declared and assigned a data type. |
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Note
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08