PRIVATE Memory Variables and Memory Allocation (112820)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft FoxPro for Windows 2.5
- Microsoft FoxPro for Windows 2.5a
- Microsoft FoxPro for Windows 2.5b
- Microsoft FoxPro for MS-DOS 2.5
- Microsoft FoxPro for MS-DOS 2.5a
- Microsoft FoxPro for MS-DOS 2.5b
This article was previously published under Q112820
In FoxPro, variables are allocated out of a general pool of FoxPro memory
that is defined statically at startup. You can set the size of this pool in
FoxPro for Windows by using the MEMLIMIT setting in the CONFIG.FP(W) file.
The number of variables and their values will not change the size of the
general memory pool defined at startup.
NOTE: In Visual FoxPro, memory is dynamically allocated, and the MEMLIMIT
statement is not used.
Despite the common phraseology, "declaring a variable private," the PRIVATE
command does not declare anything. It simply hides any higher-level
variables of the same name as lower-level variables. The only way to
declare or define a PRIVATE variable is to assign it a value.
FoxPro does not generate native code. It is an interpreter and uses the
"stack" itself. According to the glossary in the Microsoft C++ version 7.0
"Environment and Tools" manual, the stack is "a dynamically expanding and
shrinking area of memory in which data items are stored in consecutive
order and removed on a last-in, first-out basis. The stack is most commonly
used to store information for function and procedure calls and for local
variables." Therefore, variables defined in a FoxPro application cannot be
stored "on the stack" and are not static.
REFERENCES
MSDN CD 6, Microsoft C++ "Environment and Tools," version 7.0, Glossary (S)
Modification Type: | Major | Last Reviewed: | 12/3/2003 |
---|
Keywords: | kbenv KB112820 |
---|
|