Skip to content

How Precompiling Works

When a package or program is compiled with the precompile option, the compiler outputs two files:

  • A .FLP file, which is exactly like a compiled program file.
  • A .PKI (Package Include) file, which contains other information about the program just compiled.

When another program uses that file as the first statement of the program, the precompiled program will be read in from the .FLP and .PKI files instead of fully recompiling. This saves the time of compiling the used file each time.

Example

The dbForm package is required in most data-entry applications. The following command will precompile the dbForm package:

DFCOMP ENTRYFRM.PKG P

The program VENDOR needs dbForm. On the first line of the VENDOR.SRC file is the line use entryfrm. The precompiled ENTRYFRM will be loaded into the VENDOR program without having to recompile the package.

If use entryfrm was used anywhere but the first line, the .PKG file, if present, would be compiled as usual. Thus, there is a compile-time advantage to precompiling your largest package and using it first.