Compiling form specification files (.per)
The .per form definition files must be compiled to .42f XML files, in order to be loaded by the runtime system.
Understanding .per source compilation
Form specification files (with .per file extension) must be compiled to runtime form files (with .42f file extension) by using the fglform tool.
Compiled form files are XML independent from the platform and processor architecture.
The following lines show a compilation in a UNIX™ shell session:
$ cat form.per
LAYOUT
GRID
{
[f01 ]
}
END
END
ATTRIBUTES
f01 = FORMONLY.field1;
END
$ fglform form.per
$ ls -s form.42f
4 form.42f
Automatic compilation of imported modules
When compiling a .per module that includes other forms with the
FORM
instruction, fglform will automatically compile the included forms, if the
.per source is more recent as the .42f file. The included
forms can be located in a different directory as the main form.
For more details, see FORM clause.
Handling fglform compiler errors
If an error occurs, the compiler writes an error file with the .err extension.
$ cat form.per
LAYOUT
GRID
{
}
$ fglform form.per
The compilation was not successful. Errors found: 1.
The file 'form.err' has been written.
$ cat form.err
LAYOUT
GRID
{
}
# A grammatical error has been found at '}', expecting SCR_TEXT.
# See error number -6803.
With the -M
option, you can force the compiler to display an error message
instead of generating an .err error file (line break added for documentation
readability):
$ fglform -M form.per
form.per:4:1:4:1:error:(-6803)
A grammatical error has been found at '}', expecting SCR_TEXT.
Produce compiler warnings with -W
By default, the compiler does not raise any warnings. You can turn on warnings with the
-W
option:
$ cat form.per
LAYOUT
GRID
{
[f01 ]
}
END
END
ATTRIBUTES
f01 = FORMONLY.field1, WIDGET="COMBO";
END
$ fglform -Wall form.per
form.per:9: warning (-8005) Deprecated feature: The WIDGET attribute is obsolete