Precompiling
The continual recompiling of large packages and programs can be time-consuming. To speed the use of packages at compile time, the precompile option is provided.
How Precompiling Works
When a package or program is compiled with the precompile option, the compiler outputs four files, all of them in the AppSrc directory of the workspace and with the same root name as the source file:
- A file which is exactly like a compiled program file with the extension
.FLD. - A file containing debug information with the extension
.PBG. This file is identical to a.DBGfile created for a normally compiled program. - A debug package include file, which contains other information about the program just compiled with the extension
.PKD. - A file that is the intermediate compiler listing of the precompile process with the extension
.PRP. This file is identical to a.PRNfile created for a normally compiled program using the F compiler option.
When another program uses that file as the first statement of the program, the precompiled program will be read in from the .FLD, .PBG, .PKD, and .PRP files instead of fully recompiling. This saves the time of compiling the used file each time.
Example
If you frequently use a custom grid class in your non-database Windows applications, you could create a package made up of the two packages you use in all of your programs (for this example, we'll call it CustomGrid.pkg), then compile it like this:
"C:\Program Files\DataFlex {revision}\bin\DFComp.exe" -xWorkspaceName CustomGrid.pkg -p
Where:
WorkspaceNameis the name of the workspace the package resides in.
Now you can compile any program that uses the packages included in CustomGrid.pkg without having to recompile the code in all of these packages each time you compile the program.