4. Embedded SQL for Fortran : Fortran Variables and Data Types : Variable and Type Declarations : How to Declare External Compiled Forms
 
Share this page                  
How to Declare External Compiled Forms
You can precompile your forms in the Visual Forms Editor (VIFRED). This saves the time otherwise required at runtime to extract the form's definition from the database forms catalogs. For an outline of steps for UNIX, Windows and VMS, see Link Precompiled Forms in this chapter.
In UNIX, when you compile a form in VIFRED, VIFRED creates a file in your directory describing the form in the C language. VIFRED prompts you for the name of the file. After creating the file, you can compile it into a linkable object module.
In Windows, when you compile a form in VIFRED, VIFRED creates a file in your directory describing the form in the C language. VIFRED prompts you for the name of the file. After creating the file, you can compile it into a linkable object module.
In VMS, when you compile a form in VIFRED, VIFRED creates a file in your directory describing the form in the MACRO language. VIFRED prompts you for the name of the file with the MACRO description. When the file is created, you can assemble it into a linkable object module.
In UNIX, Windows, and VMS, before the Embedded SQL/FORMS statement addform can refer to this object, the object must be declared in an Embedded SQL declaration section, 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 must take place outside the Embedded SQL declaration section. (Note, however, that the previous declaration of formname as an integer must occur inside the declaration section, so that you can use formname with the addform statement.)
Note:   
The formname is the actual name of the form. VIFRED gives this name to the address of the global object. The formname is also used as the title of the form in other Embedded SQL/FORMS statements.
The external statement associates the object with the external form definition.
The following example shows a typical form declaration and illustrates the difference between using the form's object definition and the form's name:
Example: Form declaration
      exec sql begin declare section
                integer empfrm 
                ...

      exec sql end declare section
          external empfrm 
                ...

C The global object 
      exec frs addform :empfrm 
C The name of the form 
      exec frs display empfrm
          ...