You choose a data storage container according to the amount and type of data you need to store, and how you want to use it. You determine the availability of data by the way you declare it and where you create it in the program. This range of availability or effectiveness is called scope.
Most programming languages make it possible for you to store data in constants, variables, and arrays. In Visual FoxPro, you can also store data in records and objects. For more information about differences, see Visual FoxPro and Other Programming Languages.
Scope of Data Containers
The following table summarizes the scope differences between data containers.
Container | Scope | Example |
---|---|---|
Public, private, or local |
|
|
|
||
Permanent storage, accessible while the table containing the records is open |
|
|
PUBLIC Command, private, or LOCAL Command |
|
|
Referenced through the object and the object's container hierarchy |
|