Compiler Options
The compiler options configured in the external Compiler and Studio-embedded compiler are separate. Changing compiler options here will not affect those in the Studio and vice versa.
The default compiler options are -fwv1e0.
Compiler Option Rules
- Compiler options are not case sensitive.
- The options string may begin with either a
-or/, and multiple options can be appended without a space, with the exception of-x, which must be added separately from the other options.
For example,-x -v1fis correct, while-xv1fis not. - The order in which parameters are passed does not matter.
Notes regarding the samples below:
- The samples demonstrate how to pass compiler options when launching the compiler outside the Studio.
{DataFlex Install Path}is the location, including the full path, where DataFlex is installed.{Project Path}is the location, including the full path, to the folder where the DataFlex project is located, for example,C:\DataFlex Projects.
C – Force Recompile
Tells the compiler to recompile the program even if no changes are detected. Normally, the compiler looks for the compile dependency file (.dep or .pdp) and only recompiles if the compiled program is out of date with the source code. This compiler option skips the compile dependency checking and forces it to recompile the program.
E# - Error Notification Level
The compiler will report errors in the following modes: Quiet (E0), At End (E1=default), or On Each (E2).
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" -e2 MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace and stop execution on each compiler error encountered.
F & V# - Create List File & List File Verbosity
F tells the compiler to create an intermediate code listing (.PRN) file, and V# tells the compiler at what verbosity, where # is 0, 1, 2, or 99 (the default setting in the Studio is V1). The .PRN file is created in the AppSrc folder of your workspace.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" -e1fv2 MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace and stop execution at the end if any compiler error is encountered. A list (.PRN) file will be created with verbosity level 2.
I - Interface Level
The compiler handles the following interface modes, which can only be entered on the command line. Like other compiler options, these are made up of a letter (I) followed by a number.
| Interface Mode | Description |
|---|---|
| I0 Hidden | No interface or prompt is ever given, and the compilation is completely in the background. The Error Notification Level options have no effect at this level. The only way to determine compile errors is through an Error (.ERR) or List (.PRN/.PRP) file. In this mode, there is no way to halt a compilation. |
| I1 Prompt at End | No interface is given, and the compilation runs in the background. When done, a prompt is given displaying if successful or the number of errors. The Error Notifications options have no effect at this level. The only way to determine compile errors is through an Error (.ERR) or List (.PRN/.PRP) file. In this mode, there is no way to halt a compilation. |
| I2 Display Interface then Exit | An interface is shown, and all compiler options apply as normal. If a source is passed, compiling begins immediately, and the compiler exits if successful. If errors do occur, the interface remains. This is the default mode if a source file is passed. |
| I3 Always Display Interface | The interface is always shown, and all compiler options apply as normal. Compiling does not start until initiated through the interface. The interface remains whether the compilation is successful or not. This is the default mode if no source file is passed. |
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" -e1fv2i1 MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace and stop execution at the end if any compiler error is encountered. A list (.PRN) file will be created with verbosity level 2. The interface will be hidden but prompt the user at the end of compilation whether it was successful or how many compiler errors occurred.
P - Precompile
Creates precompiled program modules.
Precompiles a part of the program code or a package (e.g., DFAllEnt.pkg) and speeds up the development cycle. The code to be precompiled is considered to be static while the other program code is more dynamic.
When the P option is used, the compiler stops compilation either at the end of the source code (when, for example, DFAllEnt.pkg is precompiled) or when it detects the #ENDHEADER statement. The compiler will generate files named ProgramName.FLD, ProgramName.PBG, ProgramName.PKD, and ProgramName.PRP.
See the Precompiling section for more details about precompiling.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" CustomGrid.pkg -p
This will precompile CustomGrid.pkg in the AceCorpProject workspace.
R - Run After Compile
Tells the compiler to execute the program after a successful compile.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" -e1fv2r MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace and stop execution at the end if any compiler error is encountered. A list (.PRN) file will be created with verbosity level 2. If the program compiles successfully, it will launch after compilation completes.
W - Write Error File
Will create a .ERR file listing of the compiler errors with the same root name as the source file, in the AppSrc directory of the workspace.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" -fv2w MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace and create an error listing (.ERR) file if any compiler error is encountered. A list (.PRN) file will be created with verbosity level 2.
X - Use Workspace
If this option is used with no argument, it indicates that the current workspace is to be used for compilation. If used with an argument, the argument is the path and name of the Studio workspace (.SWS) file to use.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x MyApplication.src
This will compile MyApplication.src in the current workspace.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x "{Project Path}\AceCorpProject\AceCorpProject.sws" MyApplication.src
This will compile MyApplication.src in the AceCorpProject workspace.
-X - Use Default Registry Key
To disable the use of any workspace, place a - after the X option. When doing so, the program is not compiled using a workspace registry key. Instead, it uses the [Default] key, which is defined in the Windows Registry under HKey_Local_Machine\Software\Data Access Worldwide\DataFlex {Revision}\Defaults. The compiler should find all source components in the MakePath entry of the Dfcomp key.
This will also cause all files created by the compiler to be placed in the same directory as the source code file that is being compiled, instead of being placed in the appropriate workspace subdirectories.
Example
"{DataFlex Install Path}\bin\DFComp.exe" -x- MyApplication.src
This will compile MyApplication.src using the [Defaults] key instead of a workspace. You may have to use the full path to the source code file you want to compile:
"{DataFlex Install Path}\bin\DFComp.exe" -x- C:\MyProject\MyApplication.src