Access to Variables

Variables exist only while an application is running or during the Visual FoxPro session in which they are created. To specify the scope of a variable, use the LOCAL, PRIVATE, and PUBLIC keywords.

  • LOCAL creates variables or arrays that can be used and modified only in the program they are created, and cannot be accessed by higher or lower level programs. Local variables and arrays are released once the program containing them stops running.

  • PRIVATE hides variables or arrays that were defined in a calling program from the current program. You can then reuse those variable names in the current program without affecting the original variables. Once the program containing PRIVATE has stopped running, all variables and arrays that were declared privately are again available.

  • PUBLIC defines global variables or arrays. Global variables and arrays can be used and modified from any program you run during the current Visual FoxPro session. Any variable or array you create in the Command window is automatically public.

Expand imageAccessing Variables

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic