Compiling and Declaring External Compiled Forms - Windows
You can precompile your forms in VIFRED. By doing so, you save the time otherwise required at run time to extract the form's definition from the database forms catalogs. When you compile a form in VIFRED, VIFRED creates a file in your directory describing the form in C. VIFRED prompts you for the name of the file in which to write the description. After the file is created, you can use the following Windows command to compile it into a linkable object module:
cl –c filename
This command produces an object file containing a global symbol with the same name as your form. Before the EQUEL/FORMS statement addform can refer to this global object, you must declare it to EQUEL with the following syntax:
integer formname
Next, in order for the program to access the external form definition, you must declare the formname as an external symbol:
external formname
This second declaration is not an EQUEL declaration and you should not precede it by the ## mark. Its purpose is to inform the linker to associate the global symbol in the compiled form file with the object of the addform statement.
Syntax Notes:
• formname is the actual name of the form; it appears as the title of the form in EQUEL/FORMS statements other than the addform statement. It is also the name that VIFRED gives to the global object in the compiled form file. In all EQUEL/FORMS statements other than the addform statement that expect a form name, you must dereference formname with # so that it is interpreted as a name and not as an integer variable.
• The EXTERNAL statement associates the external form definition with the integer object used by the addform statement.
The following example illustrates these points:
## integer empfrm
external empfrm
## addform empfrm ! The global object
## display #empfrm ! The name of the form must be dereferenced
## ! because it is also the name of a variable