Microsoft KB Archive/259669

= PRB: _Include Variable Behavior with Modify Form/Class =

Article ID: 259669

Article Last Modified on 8/27/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q259669



SYMPTOMS
The purpose of the _Include system memory variable in Visual FoxPro is to specify a default header file that is included for every newly created form, formset, or class. However, if you set the _Include variable and then modify a form or class, the header file is not included in the form or class.

NOTE: Even if you use the MODIFY command to create a new form or class, the header file is not added to the form or class.



RESOLUTION
Set the _Include system memory variable before you create the new form or class, or add the header file to the form or class manually. Once the _Include system memory variable is set, be sure to create a new form or class with either the CREATE FORM or CREATE CLASS command, or from the File menu, choose New.



STATUS
This behavior is by design.



MORE INFORMATION
You can set the _Include system memory variable in several ways:  On the File menu, choose Options, choose Tools, and then choose Default Include File.  Assign the header file, including the path if it is not located in the current folder, to the _Include memory variable, as follows: _Include=&quot;headerfile.h&quot; 

You can also programmatically set a header file for a form or class. In the file structure for the form or class is a field named Reserved8. This field holds the information for the _Include header file.

Following is the code to add a header file &quot;testheader.h&quot; in a form named test.scx: USE test.scx REPLACE reserved8 WITH &quot;testheader.h&quot; USE COMPILE FORM test Class libraries must be handled differently because there can be multiple classes stored in each library.

Following is the code to add a header file &quot;testheader.h&quot; to all classes in the class library named test.vcx: CLEAR ALL && May need to issue this if class definitions exist in memory USE test.vcx REPLACE reserved8 WITH &quot;testheader.h&quot; FOR !Empty(objname) AND !EMPTY(class) USE COMPILE CLASS test (c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Dean Christopher, Microsoft Corporation.

Keywords: kbxbase kbcodesnippet kbprb KB259669

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.