MessageError()

Previous Next

Opens an error box in which it displays the specified text, then waits for the end user to click the OK button. The message is only displayed if an error occurs.

To display on-screen field values in messages, refer to these values using embedded method calls and the FORMULA() method. This allows you to concatenate on-screen values with hard-coded message text.

MessageError(FORMULA(':1 || :2 || :3',

 'All tours to ', query.destination(), ' are fully booked.'))

The resulting message could be:

All tours to Africa are fully booked.

Syntax

MessageError(<text>)

Parameters

text

The text you want to have displayed. Note the following:

· As with all non-variable method call parameters, the message itself must be enclosed in single quotes.

 

· If the text is to include single quotes ('), each of these must be written as two single quotes (''), and the message must be enclosed in single quotes.

 

· If the text is to include percent signs (%), each of these must be written as two single percent signs (%%).

 

· If the text is to include double quotes ("), these can be written normally as double quotes (").

NOTE:

If you intend to have your application translated, use MessageLanguage() instead.

A call to MessageError() triggered (directly or indirectly) from a validation event will be executed if and only if the error flag has been raised before with ErrorRaise(). Hence, if the flag has not been raised, then all calls to MessageError() will be ignored.