ERROR Command Example

The following example generates three error messages. The first error message is the Visual FoxPro error message "Variable not found" (error number 12). The second error message again generates error 12, and includes a variable name of Myvariable. The last error message is a user-defined error message (error number 1089) "My error message."

ERROR 12  && Generates the Visual FoxPro error "Variable not found"
ERROR 12, 'Myvariable'  && Variable 'Myvariable' not found error
ERROR 'My error message'  && Generates 'My error message' error