Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variables in forms
Message
From
21/08/1996 23:51:43
 
 
To
21/08/1996 09:54:02
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00006296
Message ID:
00006377
Views:
56
>I've created a header file with a number of variables that are used during my program. One of the variables, the company name, is the caption for a form. The program looks something like this:
>
> #INCLUDE "header.h"
> DO FORM Form_Dir+"\info"
>
>In the form a entered the value "=CompName" for the caption of that form. This has to be a variable value. In the header file I declared a value for CompName en Form_Dir. The problem is that the header file is read, the form executes fine, but the companyname isn't shown.
>How can I use I variable declared in a header file in a form?
>
>Michel
To clarify...
1) Variables do not come from header files. If you try to create a variable in a header file it will be skipped. Only DECLARE and compiler directives are recognized in header files.
2) If you want your header constants available inside the form's methods then you must either #INCLUDE it in each of the methods or else define it in the form menu.
3) Information declared in a header file is only available in methods. If CompName is a constant being declared in the header file then it is not available when the =CompName is run.

I would suggest that you assign the form's caption in the init method. The form does not become visible until the init method finishes running so won't see any blinking. This also allows you to pass the value as a parameter if you want. Hope this helps.

Dean :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform