MessageEx() (tick_24Validator Engine Only)

int MessageEx(int $flags[, int $msgid (use flag 4)], int $messagetype[, string $category (see flag 8)], string $message[, location exp $location]);

$flags

1 - if set, then the message is displayed; if not set, then the message is not displayed

2 - message is a style message to be displayed in the Styles tab of the integrated editor

4 - following the $flags parameter is an integer which is the message's unique ID number

8 - message has no category; do not supply the $category parameter

16 - message is an accessibility message to be displayed in the Accessibility tab of the integrated editor

32 - message is a WCAG 1.0 "priority 1/conformance level A" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor

64 - message is a WCAG 1.0 "priority 2/conformance level AA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor

128 - message is a WCAG 1.0 "priority 3/conformance level AAA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor

256 - if in standards compliant mode then upgrade $messagetype to MSG_ERROR

512 - message was generated by HTML Tidy

1024 - display message, overriding virtually any option or situation that would normally disable it (flag 1 must still be set to display the message)

2048 - message generated by nsgmls; internal use only - do not use (New v8.00)

4096 - message generated by PHP syntax checker; internal use only - do not use (New v8.9910)

8192 - for comment (MSG_COMMENT) messages - place the message at the top of all comment messages; doesn't do anything for other message types (New v8.9930)

16384 (0x4000) - put message at the very top (New v8.9940)

32768 (0x8000) - message is a WCAG 2.0 conformance level "A" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

65536 (0x10000) - message is a WCAG 2.0 conformance level "AA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

131072 (0x20000) - message is a WCAG 2.0 conformance level "AAA" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v9.9912)

262144 (0x40000) - if in standards compliant mode then upgrade $messagetype (if not an error) to MSG_WARNING (New v9.9931)

524288 (0x80000) - message was generated by the JavaScript linter (New v10.0032)

0x100000 - keyword density message (internal use only) (New v10.0047)

0x200000 - message generated by the XML parser; internal use only - do not use (New v10.9914)

0x400000 - message generated by JSLint; internal use only - do not use (New v10.9914)

0x800000 - if accessibility checking and WCAG 2.0 checking are both enabled, then also generate a WCAG 2.0 error message; use with messages about parsing problems that may cause inconsistent presentations or interpretations of the page (New v11.0111)

0x1000000 - message generated by JSHint; internal use only - do not use (New v15.9914)

NOTE: Use only zero or one of these flags: 32, 64, 128, 32768, 65536, 131072

$msgid - a unique number (no two messages should have the same $msgid number) so that the message can be individually disabled or its message type changed using the message ID feature; flag 4 must be used if supplying a $msgid (New v5.4930)

$messagetype - the type of message to display

MSGBOX_INFORMATION - displays a standard windows information dialog box on the display

MSGBOX_ERROR - displays a standard windows error dialog box on the display

MSGBOX_WARNING - displays a standard windows warning dialog box on the display

MSGBOX_YESNOQUESTION - displays a standard windows question dialog box on the display with 'Yes' and 'No' buttons; returns 1 if the user answers 'Yes' or returns 0 if the user answers 'No'

MSG_ERROR - adds an error message to the message output of the validator

MSG_WARNING - adds a warning message to the message output of the validator

MSG_COMMENT - adds a comment message to the message output of the validator

MSG_MESSAGE - adds a general message to the message output of the validator

$category - specify what category the message belongs in; for example, messages about compatibility with Microsoft Internet Explorer can all be grouped under the category "Microsoft Internet Explorer"

$message - the actual message text to display

$location - (OPTIONAL) points to the location in the html document that caused the message to be generated; the default is the first character of the tag name; this parameter is not used if $messagetype is MSGBOX_*.

Return value ("out flags"; the default is 0) (valid if $messagetype is not MSGBOX_YESNOQUESTION) (New v10.9920)

1 - message was canceled (trashed) due to configuration settings like the message ID config (always set if flag 2 is set)

2 - message was canceled (trashed) due to an exact text match to a disabled message in the message ID config (flag 1 is always set if this flag is set)

4 - message was canceled (trashed) because the cancel flag was set (New v14.9910)

This is a change from versions prior to 10.9920, where the default return value was 1, and it didn't mean anything (unless $messagetype was MSGBOX_YESNOQUESTION).

Do not use the optional $location argument if using a MSGBOX_* message type.

Start validation and end validation programs may only display comment type messages.

Example:

function onStartValidation() {
 MessageEx(13, 2015042400, MSG_COMMENT, "User functions loaded. Starting the validation!");
 MessageEx(5, 2015042401, MSG_COMMENT, "My Messages Category", "User functions loaded. Starting the validation!");
}