ERROR

From Recital Documentation Wiki
Revision as of 17:17, 10 November 2009 by Helengeorge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 Server, Recital