General information
Category:
Forms & Form designer
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only