Difference between revisions of "ERROR"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
=ERROR=
 
 
 
 
==Class==
 
==Class==
 
Error Handling and Debugging
 
Error Handling and Debugging
Line 15: Line 12:
  
 
==See Also==
 
==See Also==
[[ERROR()]], [[MESSAGE()]], [[ON ERROR]]
+
[[DB_ERRORDIR]], [[ERROR()]], [[MESSAGE()]], [[ON()]], [[ON ERROR]], [[SAVE ERROR]], [[SET ERRORVERSION]]
  
  
 
==Description==
 
==Description==
The ERROR command is used to define and signal a user-defined error.  When the ERROR command is executed, a run-time error occurs and if no ON ERROR procedure is present, an error.mem file will be generated.  If an ON ERROR procedure is present the error procedure will be called.  The ERROR() function returns the number of the last error encountered.  The MESSAGE () function returns the message of the last error encountered.  The ON ERROR command may be used to execute specified commands when an error occurs.
+
The ERROR command is used to define and signal a user-defined error.  When the ERROR command is executed, a run-time error occurs and if no ON ERROR procedure is present, an error.mem file will be generated.  If an ON ERROR procedure is present the error procedure will be called.  The ERROR() function returns the number of the last error encountered.  The MESSAGE() function returns the message of the last error encountered.  The ON ERROR command may be used to execute specified commands when an error occurs.
  
 
====<expN>====
 
====<expN>====
Line 34: Line 31:
  
 
if mfile <> "customer"
 
if mfile <> "customer"
  error 6000, "Wrong file"
+
    error 6000, "Wrong file"
 
endif
 
endif
 
</code>
 
</code>

Revision as of 10:40, 29 April 2009

Class

Error Handling and Debugging


Purpose

Create a user defined error message


Syntax

ERROR <expN>, <expC>


See Also

DB_ERRORDIR, ERROR(), MESSAGE(), ON(), ON ERROR, SAVE ERROR, SET ERRORVERSION


Description

The ERROR command is used to define and signal a user-defined error. When the ERROR command is executed, a run-time error occurs and if no ON ERROR procedure is present, an error.mem file will be generated. If an ON ERROR procedure is present the error procedure will be called. The ERROR() function returns the number of the last error encountered. The MESSAGE() function returns the message of the last error encountered. The ON ERROR command may be used to execute specified commands when an error occurs.

<expN>

The numeric expression <expN> is the user defined error number.

<expC>

The character expression <expC> is the error message to be associated with the error number.


Example

mfile = "customer"
//...
 
if mfile <> "customer"
    error 6000, "Wrong file"
endif


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer