See Also: Generic Errors, Err global indicator, ErrLine gobal indicator, Error Handling in Transactions, Explanation of user (handled) errors and unhandled errors, AddUserError, CallStackDump
To signal an error has occurred.
Error {error-num} [{message}]
Where {error-num} is the error number to report; {message} may not be longer than 1000 characters.
The Error command signals that an error has occurred. The predefined variable, Errline, is set to the line number that the error occurs. The predefined variable LastErr is set to the error number, {error-num}. Subsequent calls to the Boolean expression Err will return TRUE.
If {error-num} matches the number of an error in any of the DataFlex error database file, the message from the table for that error will be displayed. Use the Error Codes Maintenance tool (on the DataFlex Studio's Tools menu) to maintain the error database tables.
Error DFErr_Program "This is just a test."
The line number reported in DataFlex error reports is the value of Errline.
The DataFlex error tables are maintained by Data Access Worldwide and shipped with DataFlex. You should not hard-code specific error numbers into your code. Instead, use Generic Errors, such as DfErr_Operator and DfErr_Program. See the Generic Errors page in the Error Codes section for more information.
In Windows applications, if a "\n" (the new line character) is part of the string passed in the error text, a CR/LF will be inserted in the error message displayed in the message box (see Info_Box). It is the responsibility of the developer to pass the appropriate string to the command. If you do not want to have "\n" automatically replaced, make sure to pass a "\\n" in the string instead.
In Web applications, use "\n\r" to insert a line break.