ERROR

From Recital Documentation Wiki
Revision as of 11:49, 26 October 2009 by Helengeorge (Talk | contribs)

Jump to: navigation, search


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