How to Scope a Variable to a FormLast reviewed: April 30, 1996Article ID: Q126952 |
The information in this article applies to:
SUMMARYThis article explains how to declare variables that exist and are visible throughout a form but are released when the form is released.
MORE INFORMATIONA variable declared in a method of a form is visible while the method is executing. Any reference to this variable after the method exits will yield a 'Variable not Found' error message. In Visual FoxPro, the Form Designer builds a Form class, and a Form is an object. Variables declared in a method such as the Init or Load are scoped to the method. A variable scoped to a Form object has to be a member variable, or property. This differs from the version 2.x model, where variables declared in the Setup of a screen would be generated at the beginning of the .SPR file, and be available to the program and procedures that the program calls. Use the following steps to add a new property to a Form in the Form Designer:
|
Additional reference words: VFoxWin 3.00 screen private
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |