Skip to content

Compiler Error Types

Program Syntax Errors

If you misspell or misuse a DataFlex reserved word in a command line, you will get a syntax error when you compile the program. These errors are the simplest to find and the easiest to correct. Simply double-click on the error listing in the error window of the DataFlex Studio, make corrections on the indicated line(s), and recompile. You may need to refer to the online help to determine the required syntax for the command you are trying to use.

Pay particular attention to the arguments of the method or command and what type of argument is reasonable and legal to put in a particular position (e.g., trying to move a new value into a constant is both illegal and unreasonable). Most syntax errors are caused by simple misspellings or typographical errors. Very few syntax or usage errors will occur at runtime.

Another type of compile-time error is the use of duplicate symbols. If you use the same name for two variables or methods, you may get an error. Each symbol must be unique! DataFlex will not detect duplicate use of a variable if both uses are syntactically consistent with each other, so this is not a total failsafe.

You must also avoid the use of DataFlex reserved words. It is legal to use symbol substitution for command names. This will not generate an error, but great care must be exercised, and this practice is not recommended. If you use a command name as a symbol, you will get an error when you then try to use that command. In summary, when naming your files, methods, variables, and classes, make sure to use unique names that are not reserved words.

Note: The compiler needs disk space on the drive where the program is being compiled to store temporary files created during the compile process. Typically, the space needed is approximately the size of the program source file. If there is not enough space for the compiler to write its temporary files, Errors 1 or 2 will occur during compilation.

Compiler Warnings

As of DataFlex 19.1, the compiler can generate warnings, which are not fatal but allow the addition of informative messages for developers.

Read more about compiler warnings.

Fmac and Flex.cfl

Fmac is the source code file containing the DataFlex included (built-in) commands. Flex.cfl is the packed code version of Fmac, which is compiled into each application. You should not edit Fmac to extend the set of available commands in DataFlex, since you will not be able to repack Fmac into a changed Flex.cfl.

If you wish to add your own functionality to DataFlex, you should create your own classes and packages and include these in your application using the Use command.