Skip to content

Generic Errors

There are four errors classified as generic errors:

  • 4400 - DfErr_Compile
  • 4401 - DfErr_Operator
  • 4402 - DfErr_Program
  • 4403 - DfErr_Setup

These errors have entries in the error database table with error text that is intentionally left blank (errors 4400-4403). You should use these errors when you need to report an error and wish to provide all of the error message text within your code. They were created to eliminate the need for generating errors with ad-hoc error numbers. You will most frequently use these to report operator and program errors.

Example Usage

For example, if you want to report an error in your program stating, "You cannot enter negative inventory quantities," in older versions of DataFlex, there were two ways to generate this error:

Error DfErr_Operator_Error "You cannot enter negative inventory quantities"
Error 300 "You cannot enter negative inventory quantities"

The first method would generate the error: "Operator error. You cannot enter negative inventory quantities." However, you wanted to control the entire error text and do not want to see "Operator error." This text is provided by flexerrs.dat, the error database table.

The second method would generate the error: "You cannot enter negative inventory quantities." This is what you want, but to achieve this, you were forced to use an ad-hoc error number (300).

Now, you should use DfErr_Operator. It is a valid error, but the text provided from the error database table is blank. Here are some examples of how you might use these errors:

Error DfErr_Operator "You cannot enter negative inventory quantities"
Error DfErr_Program "Bad data passed in MySpecialProcedure. Contact your programmer."