Function Reference

  Previous topic Next topic  

Quick jump to function:

Integer: beginsWithCase | beginsWithNoCase | checkString | checkStringEx | checkVersion | getAttIndex | getNumAttributes | getStringStartIndex | getValueInt | hasAttStartTag | hasEqual | isCatActive | isDefined | isFlagSet | isInRange | isValueInArray | matchCase | matchNoCase | random | strcmp | stricmp | strncmp | strnicmp | strlen
Float: getValueFloat
String: convertString | convertStringEx | getAttName | getAttValue | getAttValueEx | getMidString | getTagName | getValueString | isInRangeEx | pluralize | toLower | toString | toStringF | toUpper
Location: getAttLocation | getAttValueLocation | getLocation
Procedures (no return value): activateCategory | activateCategories | checkAttributes | checkStyle | runLinkCheckProgramForTags | setClosed | setValidated | setValueString | setValueStringEx| unDefine
Function/Procedures: addValue | checkRange | checkRangeEx | checkTagAttributes | checkTagContents | checkTagUsed | Message | MessageEx | playSound | requireAllAttributes | requireMutuallyExclusiveAttributes | requireOneAttribute | runProgram | setFlag | setFlagEx | setInt | setPriority | setValueInt | writeFile

Functions

To define your own custom function, add a function to the "Functions" program in the following format (note that the keyword function must begin at the first character of a line):

function functionname() { statement; ... }

To call a function, use @functionname();.

Functions Returning Integers

int beginsWithCase(string exp string,
 string exp str1[, string exp str2...])
int beginsWithNoCase(string exp string,
 string exp str1[, string exp str2...])

These functions compare a string to a list of strings to see if string begins with any of the strings in the list. If string does not begin with any strings, then these functions will return 0, else the functions return 1 or greater. For instance, if string begins with str1, then the functions will return 1, if string begins with str2, then the functions will return 2, etc.
beginsWithCase() performs a case sensitive compare, while beginsWithNoCase() performs a case insensitive compare.
These functions are implemented only in CSE HTML Validator Std/Pro v8.9920 and later.

int checkString(int exp flags, string exp string)

flags - can be added together
1 - returns TRUE if string has leading space characters
2 - returns TRUE if string has ending space characters
4 - returns TRUE if string appears to be an absolute URL missing a protocol; v4.50 replaces character references and URL decodes before checking; v8.00 has improved detection and sets $checkstring4domain if returns TRUE
8 - returns TRUE if string begins with a letter (A-Z or a-z) and consists of the following characters: (A-Z), (a-z), (0-9), hyphens (-), underscores (_), colons (:), or periods (.)
16 - returns TRUE if string begins with a letter (A-Z or a-z)
32 - returns TRUE if string contains any collapsed PHP, ASP, etc. code. (looks for strings like "PHP", "ASP", and "MIVA" in string and returns TRUE if it finds it) (New v4.0330)
64 - returns TRUE if string ends in a '#' character (not considering trailing spaces) and string does not contain more than one '#' character (New v4.0410)
128 - returns TRUE if string contains a '#' character that is surrounded by one or more spaces and string does not contain more than one '#' character (New v4.0410)
256 - returns TRUE if string appears to be an internal link (starts with the character '#' and does not contain more than one '#' character) (New v4.0410)
512 - returns TRUE if string appears to be a valid email address (ignores the '?' character and everything after it); as of v6.01, if returning FALSE, then sets 1) $checkstring512details with details about the incorrect syntax, 2) $checkstring512detailsnumchecked with the number of email addresses checked (new v6.50), and 3) $checkstring512detailsqmarkindex with the index of the first occurance of the character '?' based on the last checked email address (new v6.50); as of v6.01, works with multiple email addresses separated by commas NOTE: Always returns TRUE if email address syntax checking has been disabled. (New v4.05)
1024 - use with 512; ignores any "mailto:" prefix in string when checking for a valid email address (New v4.05)
2048 - returns TRUE if the string contains any spaces (New v4.5000)
4096 - returns TRUE if a '%' character is found that is not followed by two hexadecimal digits (New v4.5000)
8192 - returns TRUE if string consists only of lowercase characters, numbers, backslashes, and underscore characters, and has a maximum of one colon and one period (New v4.5021)
16384 - returns TRUE if string consists only of lowercase characters, numbers, and underscore characters, and has a maximum of one period (New v4.5022)
32768 - returns the number of possible misspellings in string and adds the possibly misspelled words to the list of possibly misspelled words (New v4.5091)
65536 - use with 512; URL decode (percent-decode) email address before checking (New v7.9914)
string - the string to check
The default return value is 0 unless it is changed due to a flag.
This function is implemented only in CSE HTML Validator Std/Pro v4.0320 and later.

int checkStringEx(int exp flags, int exp mode,
 string exp string)

flags - can be added together; the flags value depends on mode so see the values for mode below for available flags; if a mode does not say anything about flags, then the flags value is not used and should be 0.
mode - can not be added together
1 - return TRUE if string is a valid charset like "iso-8859-1"
2 - return TRUE if string ends with a comma (disregarding trailing whitespace) (New v5.0200)
3 - return TRUE if string appears to be a valid "lang" attribute value (New v5.4910)
4 - return TRUE if string begins with a '#' character (disregards preceding whitespace) (New v5.4910)
5 - return TRUE if string contains two or more adjacent hyphens (use for checking comments; excludes beginning "!--" and ending "--", returns FALSE if string begins with "!--#"); if returns TRUE then use getLocation(5,0) to get location of hyphens (New v5.4910)
6 - return TRUE if string ends in "--" followed by one or more spaces (New v5.4910)
7 - return the number of words in string (New v5.4930)
8 - return the number of repeated words/phrases given a comma separated list in string; a list of repeated words/phrases is stored in $repeatedlist; the number of "empty" words is stored in $numemptywords (New v5.4940)
9 - returns TRUE if string is a percent, else returns FALSE (New v5.4940)
10 - returns TRUE if string contains only digits 0-9 (must contain at least one digit), else returns FALSE; flags below (New v5.5100)
1 - allow leading whitespace
2 - allow trailing whitespace
4 - allow an optional preceeding '-' character
8 - require preceeding '-' character
16 - allow zero or one '.' characters
32 - require one '.' character
64 - allow an optional ending '%' character
128 - require ending '%' character
256 - instead of returning TRUE or FALSE, return one of following values
>=0 - value is OK
<0 - value is NOT OK
1 - value is a percent >100% (only if flag 512 set)
-1 - miscellaneous reason why value is not OK
-2 - misplaced or multiple '-' characters
-3 - multiple '.' characters
-4 - missing required '-' character
-5 - missing required '.' character
-6 - missing required '%' character
-7 - contains unallowed character or bad format
-8 - contains no digits (must contain at least 1)
512 - use with flag 256 to allow a return value of 1
11 - returns TRUE if string contains only whitespace characters (one or more), else returns FALSE (New v5.9910)
12 - returns TRUE if string is an index page (such as "index.htm", "index.html", "index.php", "index.asp") or if the string ends in a "/" followed by an index page, else returns FALSE (New v5.9910)
1 - if returning TRUE, then create variables $checkstringex12docname (contains "index.htm", "index.php", etc) and $checkstringex12recommendedurl (contains the recommended replacement URL)
13 - returns TRUE if string contains a semicolon and period but no comma between two '@' characters, else returns FALSE (used for checking mailto links with multiple email addresses that could incorrectly be separated with semicolons instead of commas) (New v6.4930)
14 - returns TRUE if string contains optional whitespace followed by optional digits (0-9) followed by optional whitespace followed by a CSS length unit, else returns FALSE; if returns TRUE, then the length unit is stored in $checkstringex14unit (New v6.4930)
15 - returns TRUE if string appears to contain mismatched double or single quotation marks, else returns FALSE (New v6.4940)
1 - only check if value is <=100 characters
16 - returns TRUE if string appears to contain improper backslashes instead of forward slashes (use for checking links) (New v6.9921)
17 - returns TRUE if string appears to contain an improper double slash sequence (use for checking links) (New v6.9931)
18 - returns the number of commas in string (New v7.0000)
19 - returns TRUE if string is recognized as a web-safe typeface; if there are no recognized web-safe typefaces (if the list of recognized web-safe typefaces has been cleared), then will always return TRUE (New v8.00)
20 - checks a comma separated list of typefaces in string and returns FALSE if any of them are not recognized as "web-safe", which means that they may not be available on a significant number of browsers; else returns TRUE; if returns FALSE, then a list of the unrecognized typefaces is available in $checkstringex20list (with $checkstringex20listnum containing the number of typefaces in the list) and a complete list (including ignored typefaces) is available in $checkstringex20list2 (with $checkstringex20list2num containing the number of typefaces in the list).
 
In v8.9950 and above, if not all the typefaces are web-safe, then $checkstringex20unknownlist is also set with a list of unrecognized typeface names. $checkstringex20unknownlistnum contains the number of typefaces listed in $checkstringex20unknownlist.
 
NOTE: Once a typeface is recognized as not being web-safe, then it is ignored in further calls to this function for the duration of the validation. This is to prevent the same typeface (when used multiple times) from generating more than one validator message. You can add to the recognized list of web-safe typefaces using setValueString(10,typeface name) in the onConfigLoad() function. flags below
1 - do not consider ignored typefaces from previous calls when returning TRUE or FALSE
2 - do not use; this flag used internally
21 - checks a comma separated list of typefaces in string and returns FALSE if there are any unrecognized typefaces or if typefaces from more than one family were specified. If returns FALSE, then sets $checkstringex21msg with the text of a message to display, $checkstringex21numunrec with the number of unrecognized typefaces, $checkstringex21msgtype with the recommended message type (regular message if there were no unrecognized typefaces or a warning message type if there were unrecognized typefaces), and (in v9.0192 and later) $checkstringex21msgid with a recommended message ID. NOTE: Once a typeface is not recognized, it is ignored in further calls to this function for the duration of the validation. This is to prevent the same typeface being used multiple times from generating more than one validator message about it. You can add to the recognized list of typefaces using setValueString(11,typeface name) in the onConfigLoad() function. flags below
2 - do not use; this flag used internally
22 - returns TRUE if string contains a Sitestepper variable and Sitestepper integration is both on and supported in the edition being used (supported in std/pro editions) (New 8.0200)
23 - returns TRUE if string appears to be a link that can be passed to the link checker (preceding space  characters are ignored) (New 8.9910)
24 - returns TRUE if string is a recognized typeface name (New 8.9950)
string - the string to check
The default return value is 0 (FALSE) unless it is changed due to a valid mode.
This function is implemented only in CSE HTML Validator Std/Pro v4.9910 and later.

int checkVersion(float exp version)

version - the minimum version of the validator required for the function to return 1
Returns 1 if using HTML Validator version version or greater, else the function returns 0.
Use this to help make sure that the procedures and functions that are being used are valid for the version of CSE HTML Validator that is executing them.

int getAttIndex(string exp attribute)

attribute - the attribute in the tag to search for
Returns the index of the attribute. If the attribute does not exist, then the function returns 0. For example, if the attribute exists and is the first attribute for the tag, then the function returns 1.

int getNumAttributes()

Returns the number of attributes for the current tag.

int getStringStartIndex(string exp string1, string exp string2)

Searches for string2 in string1 and returns the index into string1 where string2 starts.
The index is 0 based. For example, if string2 is contained in the very beginning of string1, then the function returns 0.
If string2 is not in string1, then the function returns -1.
Performs a case insensitive search.
This function is implemented only in CSE HTML Validator Std/Pro v3.03 and later.

int getValueInt(int exp valueidentifier)

valueidentifier - tells the function which value to return
1 - the current number of error messages generated
2 - the current number of warning messages generated
3 - the current number of message messages generated
4 - the current number of comment messages generated
5 - returns 1 if compiled for a "normal" build (not an OEM version), else returns another value
6 - returns 1 if running from command line arguments, else returns 0
7 - returns 1 if processing a batch (for example, called with cmdlineprocessor.exe -f), else returns 0
8 - returns the number of lines in the document (New v4.00)
9 - returns the number of elements (tags) in the document (New v4.00)
10 - returns the number of elements (tags) that have been ended (with an end tag) (New v4.00)
11 - returns the number of HTML comments in the document (New v4.00)
12 - returns the number of entities in the document (New v4.00)
13 - returns the number of tag name programs run (New v4.00)
14 - returns 1 if the validator is generating an easily parsed output file (usually used when integrating with other applications), else returns 0 (New v4.00)
15 - returns 1 if the validator is validating a file in CSE's integrated editor (not in classic mode), else returns 0 (New v4.00)
16 - returns 1 if the validator is validating a file in CSE's integrated editor (whether in classic mode or not), else returns 0 (New v4.00)
17 - returns the number of bytes in the document (each newline is considered 1.5 bytes) (New v4.0012)
18 - returns 1 if the validator is validating a file in the Batch Wizard, else returns 0 (New v4.02)
19 - returns 1 if there have been too many errors or warnings and the validation is being terminated (New v4.5021)
20 - returns CSEJOBSUBTYPE (New v4.5091)
21 - returns the attribute index for attribute programs or attribute value programs (should be >=1)(New v4.5091)
22 - returns doctypeflags (contains information about the DOCTYPE being used) (New v4.5110)
1 - DOCTYPE is empty string
2 - DOCTYPE contains "strict" (case insensitive)
4 - DOCTYPE contains "transitional" (case insensitive)
8 - DOCTYPE contains "frameset" (case insensitive)
16 - DOCTYPE contains "HTML 4.0" or "HTML 4.01" (case insensitive)
32 - DOCTYPE contains "XHTML" (case insensitive)
64 - DOCTYPE contains "XHTML 1.1" (case insensitive) (New v5.0200)
128 - DOCTYPE contains "XHTML 1.0" (case insensitive) (New v5.0200)
256 - DOCTYPE contains "HTML" (case insensitive) (New v5.4910)
512 - DOCTYPE contains "XHTML Basic" (case insensitive) (New v5.4920)
1024 - Document has no DOCTYPE (or the DOCTYPE hasn't been set/encountered yet) (New v5.4930)
2048 - DOCTYPE contains "HTML 3.2" (case insensitive) (New v5.9910)
4096 - DOCTYPE contains "HTML 3.0" (case insensitive) (New v5.9910)
8192 - DOCTYPE contains "HTML 2.0" (case insensitive) (New v5.9910)
16384 - DOCTYPE contains " HTML 4.0" followed by a non-digit (case insensitive) (New v6.4930)
32768 - DOCTYPE contains " HTML 4.01" (case insensitive) (New v6.4930)
65536 - DOCTYPE contains "HTML" but not "XHTML" (case insensitive) (New v6.4930)
131072 - DOCTYPE contains " mobile" (case insensitive) (New v9.0200)
Only one or none of the following flags will be set: 16, 2048, 4096, 8192
23 - returns the number of characters of the text content of the tag that is being closed; preceding and trailing spaces are not considered; stores the text content (preceding and trailing spaces, if any, are removed) in a variable named getvalueint23content; use in a tag close program only; see also 41 (New v5.4930)
24 - returns 1 if checking an external style sheet, else returns 0 (New v5.4930)
25 - returns 1 if the current tag is closed with "/>", else returns FALSE; use in a tag name open program, attribute program, or attribute value program only (New v5.5100)
26 - returns 1 if accessibility checking is enabled else returns 0 (New v5.9910)
27 - returns 1 if WCAG 1.0 accessibility checking is enabled else returns 0 (New v5.9910)
28 - returns 1 if Section 508 accessibility checking is enabled else returns 0 (New v5.9910)
29 - returns 1 if both accessibility checking and WCAG 1.0 accessibility checking are enabled else returns 0 (New v5.9910)
30 - returns 1 if both accessibility checking and Section 508 accessibility checking are enabled else returns 0 (New v5.9910)
31 - returns 1 if the enable sound option is checked else returns 0 (New v5.9920)
32 - returns the number of CDATA sections in the document (New v5.9920)
33 - returns 1 if WCAG Priority 1 messages should be displayed, else returns 0 (New v5.9930)
34 - returns 1 if WCAG Priority 2 messages should be displayed, else returns 0 (New v5.9930)
35 - returns 1 if WCAG Priority 3 messages should be displayed, else returns 0 (New v5.9930)
36 - returns 1 if the job flag for "beginner mode" has been set, else returns 0 (New v6.5200)
37 - returns the number of entries in the ignored CSS properties list (New v7.9910)
38 - returns whether to display legacy validator messages or not; depends on legacyflag and whether the flag specified by legacyflag is set or not (New v7.9910)
39 - returns 1 if in standards compliant mode, else returns 0 (New v7.9923)
40 - returns 1 if general search engine messages are enabled, else returns 0 (New 8.9910)
41 - same as 23 except "{text}" is used for ASP and PHP code sections; see also 23 (New v9.0000)
42 - returns the current total number of words spell checked, including words in comments (New v9.0194)
43 - returns the current total number of words spell checked in HTML/XHTML comments (New v9.0194)
50 - returns valjobflags (New v6.4930)
100 - returns the current four-digit year (local time) (New v6.0091)
101 - returns the current month (1-12, local time) (New v6.0091)
102 - returns the current day (1-31, local time) (New v6.0091)
103 - returns the current hour (0-23, local time) (New v6.0091)
104 - returns the current minute (0-59, local time) (New v6.0091)
105 - returns the current second (0-59, local time) (New v6.0091)
106 - returns the current millisecond (0-999, local time) (New v6.0091)
107 - returns the current day of the week (0-6, Sunday=0, Monday=1, etc., local time) (New v6.0091)
Returns -1 if an error occurs, such as if valueidentifier is invalid. This function will not generate a validator error message if it returns -1 because valueidentifier is invalid.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

int hasAttStartTag(string exp attribute)

Returns 1 if attribute exists in the start tag, else returns zero.
Use only in tag name close programs.
May require that runProgram(21) be used in the start tag name program.
This function is implemented only in CSE HTML Validator Std/Pro v8.00 and later.

int hasEqual(int exp index)

Returns 1 if the attribute at index has an equal sign following it, else returns zero.

int isCatActive(int exp categoryid)

categoryid - the id of the category to check
If the category is active, then the function returns 1, else the function returns 0. The active categories are typically set in the Configuration Editor, but can also be set using activateCategories().

int isDefined(string exp name)

name - the name of the variable
Returns 0 if the variable name has not been defined, else the function returns nonzero.

int isFlagSet(int exp flag)

flag - the tag name program flag to check
If the tag name program flag is set, then the function returns 1, else the function returns 0. The tag name program flags are set in the Validator Engine Options, but can also be set using setFlag().

int isInRange(string exp tagname1[, string exp tagname2...])

Returns a positive integer if the current tag is in the range of any of the listed tag names, else the function returns 0. A tag name (called tag1) is in the range of another tag (called tag2) if tag2 has been opened but not ended before tag1.

int isValueInArray(string exp arrayname,
 string exp value[, int flags])

Checks to see if the value value is in the array of values named arrayname
Returns the first index into the array that equals value or returns -1 if value is not found.
flags
1 - case sensitive search (else case insensitive search)
This function is implemented only in CSE HTML Validator Std/Pro v4.52 and later.

int matchCase(string exp string,
 string exp str1[, string exp str2...])
int matchNoCase(string exp string,
 string exp str1[, string exp str2...])

These functions compare a string to a list of strings to see if string matches any of the strings in the list. If string does not match any strings, then these functions will return 0, else the functions return 1 or greater. For instance, if string matches str1, then the functions will return 1, if string matches str2, then the functions will return 2, etc.
matchCase() performs a case sensitive compare, while matchNoCase() performs a case insensitive compare.

int random(int exp num)

Returns a random number between 0 and num-1.
This function is implemented only in CSE HTML Validator Std/Pro v7.01 and later.

int strcmp(string exp string1, string exp string2)
int stricmp(string exp string1, string exp string2)
int strncmp(string exp string1, string exp string2,
 int exp length)
int strnicmp(string exp string1, string exp string2,
 int exp length)

These functions compare two strings and return a comparison value. The function returns a value of zero, less than zero, or greater than zero if string1 is equal to, less than, or greater than string2, respectively.
strcmp() and strncmp() perform a case sensitive compare
stricmp() and strnicmp() perform a case insensitive compare
Functions with a length parameter only compare up to the first length characters.

int strlen(string exp string)

Returns the length, in characters, of string.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

Functions Returning Floats

float getValueFloat(int exp valueidentifier)

valueidentifier - tells the function which value to return
1 - the validation time in seconds
Returns -1 if an error occurs, such as if valueidentifier is invalid.
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

Functions Returning Strings

string convertString(int exp flags,
 string exp string)

flags - tells the function what to do to string
1 - convert character entities (for example, convert &quot; to ")
2 - extracts a link from a string in the format linkpage("link") or linkpage('link'); returns an empty string if no link can be extracted (New v4.5031)
4 - try to extract a charset from string by returning what is found after "charset=" in string; returns the extracted charset or an empty string if a charset could not be extracted (New v4.9910)
8 - convert consecutive whitespace characters in string to single space characters (New v5.9910)
16 - remove space characters in string (New v5.9930)
32 - URL decode (New v7.9914)
65536 - remove preceding and trailing whitespace characters from string (New v5.9910)
If flags specifies unknown flags or an error occurs, then the function may return string unmodified. It will not generate an error.
This function is implemented only in CSE HTML Validator Std/Pro v4.50 and later.

string convertStringEx(int exp mode,
 string exp string)

mode - tells the function what to do to string
1 - remove all non-alpha characters including whitespace
If mode is unknown or an error occurs, then the function will, in most cases, return string unmodified. It will not generate an error.
This function is implemented only in CSE HTML Validator Std/Pro v8.00 and later.

string getAttName(int exp index)

Returns an attribute of the tag, specified by index. The first attribute has an index of 1. An index of 0 returns the current tag name.
Generates an error if the attribute at index does not exist.

string getAttValue(int exp index)

Returns the attribute value of an attribute of the tag, specified by index. The first attribute value has an index of 1, and is the attribute value for the attribute that also has an index of 1. An index of 0 is the value attached to the tag name which generally should not exist.
The attribute value returned is the value after the character references have been replaced with the actual characters.
Generates an error if the attribute at index does not exist, because if the attribute doesn't exist, then it can't have a value.

string getAttValueEx(int exp index, int exp flags)

Returns the attribute value of an attribute of the tag, specified by index. The first attribute value has an index of 1, and is the attribute value for the attribute that also has an index of 1. An index of 0 is the value attached to the tag name which generally should not exist.
flags
1 - get the value after character references have been replaced with the actual characters
2 - get the value before character references have been replaced with the actual characters
Generates an error if the attribute at index does not exist, because if the attribute doesn't exist, then it can't have a value.
This function is implemented only in CSE HTML Validator Std/Pro v5.02 and later.

string getMidString(string exp string,
 int exp startindex, int exp length)

Returns a substring of string. The substring begins at the 0 based index startindex and is length characters long.
If length is -1, then the returned string begins at startindex and ends at the last character of string.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

string getTagName()

Returns the current tag name that the validator is validating.
The tag name is returned as used in the document without any case conversion. For example, if <BoDy> is used in the document, then getTagName() returns BoDy.

string getValueString(int exp valueidentifier)

valueidentifier - tells the function which string value to return
1 - the folder where HTML Validator is installed (ends with a \)
2 - the folder where Windows is installed (uses the GetWindowsDirectory() API function and only ends in a \ if Windows is installed in a root directory)
3 - the !DOCTYPE declaration (starts with !DOCTYPE and does not include the < and > characters at the beginning and end of the string) (New v4.05)
4 - the version of the configuration being used (as specified in the Notes tab of the Configuration Editor) (New v4.5020)
5 - the filename or URL (with full path if available) of the document being validated (if available) (New v4.5020)
6 - the filename (without path) of the file being validated (if available) (New v4.5022)
7 - returns " If you're using HTML Validator's integrated editor, then this can be added from the 'Tags' menu or from the Tag Inserter." (New v4.5094)
8 - a message about the DOCTYPE ($doctypestring) not being recognized if it is not in the recognized DOCTYPE list; use only in a DOCTYPE tag name program; returns "" if $doctypestring is in the list or if the list is empty (New v4.9940)
9 - the sound file to play when errors and/or warning messages are present (New v5.0200)
10 - the sound file to play when no errors and/or warning messages are present (New v5.0200)
11 - returns " /" if document is XHTML or "" if not (New v5.4930)
12 - returns "/" if document is XHTML or "" if not (New v5.4930)
13 - returns the text (character references are not converted) contained in the tag that is being closed, excluding beginning and trailing spaces; use in a tag close program only; to get the location of this text, call getLocation(3,0); use 30 or 32 instead of 13 to include beginning and trailing space characters (New v5.4930)
14 - returns the document type (based mainly on the DOCTYPE); example: "XHTML 1.1", "strict HTML 4.0/4.01", "strict XHTML 1.0", etc. (New v5.4950)
15 - returns the document type with "a" or "an" preceding it (based mainly on the DOCTYPE); example: "an XHTML 1.1", "a strict HTML 4.0/4.01", "a strict XHTML 1.0", etc. (New v5.4950)
16 - if the "align" attribute is used then returns a string, starting with a space, asking to consider CSS instead of the "align" attribute (New v5.9910)
17 - if the "bgcolor" attribute is used then returns a string, starting with a space, asking to consider the "background-color" CSS property instead of the "bgcolor" attribute (New v5.9910)
18 - if the "align" attribute is used then returns a string, starting with a space, asking to consider the CSS "text-align" property instead of the "align" attribute (New v5.9910)
19 - similar to 14 but returns something like "XHTML 1.1", "HTML 4.01 Strict", "XHTML 1.0 Strict", etc. (New v6.4930)
20 - if the "background" attribute is used then returns a string, starting with a space, asking to consider the "background-image" CSS property instead of the "background" attribute (New v6.9910)
21 - if the "text" attribute is used then returns a string, starting with a space, asking to consider the "color" CSS property instead of the "text" attribute (New v6.9910)
22 - if the "alink" attribute is used then returns a string, starting with a space, asking to consider the ":active" CSS pseudo-class instead of the "alink" attribute (New v6.9910)
23 - if the "link" attribute is used then returns a string, starting with a space, asking to consider the ":link" CSS pseudo-class instead of the "link" attribute (New v6.9910)
24 - if the "vlink" attribute is used then returns a string, starting with a space, asking to consider the ":visited" CSS pseudo-class instead of the "vlink" attribute (New v6.9910)
25 - returns a recommendation not to use frames due to usability and search engine issues (New v7.9910)
26 - returns a list of ignored CSS properties (if any) (New v7.9910)
27 - returns, if set, a string with legacyflag in square brackets followed by a space; example: "[114] " if legacyflag has been set to 114 (New v7.9910)
28 - returns a string of used accesskeys
29 - returns a string of unused accesskeys
30 - returns the text (character references are not converted) contained in the tag that is being closed, including beginning and trailing spaces; use in a tag close program only; to get the location of this text, call getLocation(3,0); use 13 instead of 30 to exclude beginning and trailing space characters; also see 32 (New v8.9910)
31 - returns a string like " The color "darkgreen" is the same as "#006400" in HTML/CSS." for the color name (darkgreen in this example) stored in the variable $getvaluestring31colorname. If there is no value for $getvaluestring31colorname or the color name does not exist or is unknown, then returns an empty string (New v8.9910)
32 - returns the text (character references are not converted) contained in the tag that is being closed, including beginning and trailing spaces and including "{text}" for ASP and PHP code sections; use in a tag close program only; to get the location of this text, call getLocation(3,0); see also 13 and 30 (New v8.9920)
Returns "error" if an error occurs, such as if valueidentifier is invalid.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

string isInRangeEx(int exp flags,
 string exp tagname1[, string exp tagname2...])

Returns the name of the tag that the current tag is in the range of (must be one of the listed tag names), else the function returns an empty string (""). A tag name (called tag1) is in the range of another tag (called tag2) if tag2 has been opened but not ended before tag1.
flags
1 - if the current tag is in the range of a listed tag name, stores the line number where the tag appears in the variable named "$isinrangeexline".
This function is implemented only in CSE HTML Validator Std/Pro v4.0310 and later.

string pluralize(string exp str, int num[, int mode)

str - the string to pluralize
num and mode - determine what to do
If mode is 0 (the default), then returns str if num is 1, else returns str+"s"
If mode is 1, then returns str+"y" if num is 1, else returns str+"ies"
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

string toLower(string exp string)

string - the string to convert to lowercase
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

string toString(int exp convert)

convert - the integer to convert to a string

string toStringF(float exp convert[, string format])

convert - the float to convert to a string
format - how to format the returned string, default is "%.2f" for 2 decimal places
WARNING: A bad format string may cause CSE HTML Validator to crash.
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

string toUpper(string exp string)

string - the string to convert to uppercase
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

Functions Returning Locations

location getAttLocation(int exp index)

Returns the location of the first character of an attribute of the tag, specified by index. The first attribute has an index of 1. An index of 0 returns the location of the first character of the tag name.
Generates an error if the attribute at index does not exist.

location getAttValueLocation(int exp index)

Returns the location of the first character of an attribute value of an attribute of the tag. index is the index of the attribute whose value you want the location of. The first attribute has an index of 1.
Generates an error if the attribute at index does not exist or if index is 0 or less.

location getLocation(int exp locid, int exp auxint)

Returns a location based on locid and auxint.
locid - location ID
1 - location of a structure component; auxint is the structure component's ID number
2 - location of tag with all attributes and values (New v4.9940)
Use 0 for auxint for standard behavior
Use 1 for auxint to include ending spaces (New v5.4910)
Use 2 for auxint to only include ending spaces (New v5.4910)
3 - location of the text referred to in getValueInt(23) or getValueString(13); auxint should be 0 (New v5.4930)
4 - location of the last child of the current node; auxint should be 0 (New v5.9920)
5 - location of the current CSS property if available; auxint should be 0 (New v7.9910)
6 - location of the first character of line number auxint (New v7.9910)
7 - location of the bad hyphens after calling checkStringEx(0,5); if not available then returns getLocation(2,1) (New v7.9920)
As of v4.9940, the flags parameter has been changed to locid.
This function is implemented only in CSE HTML Validator Std/Pro v4.5091 and later.

Procedures

activateCategory(int exp categoryid, int exp activate);

categoryid - the category id of the category to activate or deactivate
activate - if non-zero, activates the category; if zero, deactivates the category
To deactivate all categories, use -1 for categoryid and 0 for activate
This procedure does nothing if you try to deactivate a category that is not active or activate a category that doesn't exist.
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

activateCategories(int exp
 activate[, int exp categoryid...]);

categoryid - the category id of the category to activate or deactivate
activate - if non-zero, activates the category; if zero, deactivates the category
This procedure does nothing if you try to deactivate a category that is not active or activate a category that doesn't exist.
This function is implemented only in CSE HTML Validator Std/Pro v5.4940 and later.

checkAttributes(int exp flags,
 string exp att1[, string exp att2...]);

flags
1 - display a standard warning message if any of the listed attributes have values that have leading or trailing spaces; if a listed attribute does not exist then it is treated as though it does not have leading or trailing spaces.
2 - add "[33] " to the beginning of the standard warning message.
attx - an attribute
This function is implemented only in CSE HTML Validator Std/Pro v4.0320 and later.

checkStyle(int exp flags);

flags
1 - check the "style" attribute value if style checking is enabled; if there is no "style" attribute in the current tag, then this function does nothing.
2 - check the style declarations contained in the tag; use this only in an end tag name program like the end tag name program for the "script" element.
This function does not do anything if style checking is not enabled.
This function is implemented only in CSE HTML Validator Std/Pro v4.9910 and later.

runLinkCheckProgramForTags(string exp
 tagname1[, string exp tagname2...]);

Specifies the elements that cause the link check tag name program to execute during a link check. Using this function results in a significant performance improvement compared to not using this function.
This function can only be used in the link check tag name program so it has no use or effect in other tag name programs or when validating.
This function is implemented only in CSE HTML Validator Std/Pro v4.4910 and later.

setClosed(int exp id);

id - the ID number of the tag name to mark as closed; this ID is the ID of the tag name in the document structure, not in the configuration

setValidated(int exp index, int exp what);

index - the index of the attribute and/or attribute value to set
what - what to set (specifies to set the attribute, the attribute value, or both)
$SET_ATTRIBUTE - set the attribute to be valid so that no error messages are generated for the attribute
$SET_ATTVALUE - set the attribute value to be valid so that no error messages are generated for the attribute value
To set both at the same time, use $SET_ATTRIBUTE+$SET_ATTVALUE.

setValueString(int exp valueidentifier,
 string exp value[, string exp value2,
 string exp value3...]);

valueidentifier - tells the function which string value to set
1 - a string that is used to override the default warning string about not using a space character before a '/' character in XML style empty tags
2 - add the value string to the list of validation modes; good to use in the onConfigLoad() function to specify new validation modes. The first string added will have a CSEJOBSUBTYPE of 1, the second string added will have a CSEJOBSUBTYPE of 2, etc. (New v4.5091)
3 - add the value string to the list of recognized doctypes; good to use in the onConfigLoad() function; example: setValueString(3,'!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html401/strict.dtd"'); (New v4.9940)
4 - set the DOCTYPE tag name program to value; good to use in the onConfigLoad() function; also see 19 (New v4.9940)
5 - set the XML declaration tag name program to value; good to use in the onConfigLoad() function (New v5.4910)
6 - set the comment tag name program to value; good to use in the onConfigLoad() function (New v5.4910)
7 - set the ignore to end tag name program to value; good to use in the onConfigLoad() function; program is run when a nested ignore to end tag is encountered (New v5.4920)
8 - limit messages to those having a category name that matches value (case insensitive); can be called repeatedly to limit messages to multiple categories (New v5.4930)
9 - set the entity tag name program to value; good to use in the onConfigLoad() function (New v5.4940)
10 - add the value string to the list of recognized "web-safe" typefaces; good to use in the onConfigLoad() function; add an empty string to clear the list (New v7.9910)
11 - add the value string to the list of recognized typefaces; good to use in the onConfigLoad() function if you are using an unusual typeface that CSE HTML Validator does not recognize (New v7.9910)
12 - add the value string to the list of ignored CSS properties; if a property has already been added to the list then it is not added again; good to use in the onUnknownCSSPropertyMessage() function; this list is used to generate a validator  message listing the ignored CSS properties (New v7.9910)
13 - add the value string to the list of DOCTYPE strings that can be validated using a DTD and nsgmls but not CSE HTML Validator's own validation engine (like "-//W3C//DTD SVG 1.1//EN"); good to use in the onConfigLoad() function (New v7.9910)
16 - limit messages to those having a category name that contains value anywhere in the name (case insensitive); can be called repeatedly to limit messages to multiple categories (New v8.9910)
17 - add the value string to the list of recognized JavaScript content types; good to use in the onConfigLoad() function; does nothing in lite edition (New v9.0191)
18 - add the value string to the list of recognized CSS content types; good to use in the onConfigLoad() function; does nothing in lite edition (New v9.0191)
19 - append to the DOCTYPE tag name program to value; good to use in the onConfigLoad() function; also see 4 (New v9.0201)
In CSE HTML Validator Std/Pro v8.00 and later, can specify multiple value strings. This makes sense for some valueidentifiers but not all.
This function is implemented only in CSE HTML Validator Std/Pro v4.05 and later.

setValueStringEx(int exp valueidentifier1,
 int exp valueidentifier2, int exp arg1,
 string exp value);

valueidentifier1 - what string value to set
1 - set an attribute value string
valueidentifier2 - further specifies which string to set
1 - the attribute value tag name program
arg1 - the attribute value ID
2 - append value to all validator messages having a specific message ID; before appending to a message, a space character is automatically appended first unless it's a blank message (new v7.9911)
valueidentifier2 - should be 0
arg1 - the message ID of the messages to append with the string value
value - the string value
This function is implemented only in CSE HTML Validator Std/Pro v5.00 and later.

unDefine(string exp name1[, string exp name2...]);

namex - the list of variable names to remove from memory
After this function is used on a variable, such as name1, isDefined("name1") will again return 0. Accesses to the variable name will fail because it will no longer exist.
If a variable name in the list is already undefined, then the function has no effect on the undefined variable name.
Example: To remove a variable named var from memory, use unDefine("var"), do not use unDefine($var).

Combination Functions and Procedures

int addValue(string exp varname
 string exp value[, int flags]);

Adds value to the end of an array of values named varname.
flags
1 - do not add if value is empty, that is, if it is equal to "".
2 - do not add if value is "ASP", "PHP", "MIVA", etc. This usually indicates that ASP, PHP, etc. code has been converted to the corresponding string (New v5.9910)
Returns the index into the array varname where value has been stored. If an error occurred or no value was stored, then addValue() returns -1.
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

int checkRange(int exp flags, int exp returntype,
 string exp isopentag, string exp
 tagname1[, string exp tagname2...]);

flags
1 - display a default error message if isopentag is currently open, but tagname1, tagname2, etc. are all not open, else the default error message is not displayed
2 - don't consider the last added component when searching for isopentag (New v4.5000)
This function's return value depends on returntype:
If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
If returntype is $RETURN_LISTINDEX, then the return value is 0 if isopentag is not open, 1 if isopentag is open but no tagnamex is open, and 2 or greater if isopentag is open and tagnamex is open. If the value is 2 or greater, then the return value indicates the first tagnamex in the list that is open.
tagnamex - a tag name to check to see if it is currently open; tagnamex is only checked to see if it is open if isopentag is open, and if isopentag is open, then tagnamex is only considered to be open if tagnamex is opened after isopentag
Functionality change in CSE HTML Validator Std/Pro v4.50 and later: display has been replaced with flags

int checkRangeEx(int flags, string exp
 tagname1[, string exp tagname2...]);

flags
1 - display default message (if any)
2 - (valid only in text program) check to make sure that no tag name in the list of tag names is opened; if one or more tag names are open then displays an error message that text cannot be used in the opened tag name (message displayed only if flag 1 is also set) and returns 1 if the opened tag is tagname1, 2 if tagname2, etc.; if no tag name in the list is open, then returns 0
tagnamex - list of tag names
This function is implemented only in CSE HTML Validator Std/Pro v4.05 and later.

int checkTagAttributes(int exp checktype, int exp
 flags[, any optional parameters]);

checktype
1 - supply two additional string parameters, attname and valuecontains; checks the last child of the current node and returns 1 if it contains an attribute named attname and that attribute has a value that contains the string valuecontains, else returns 0; a case insensitive compare is made; valuecontains may be anywhere in the value

int checkTagContents(int exp checktype, int exp
 flags, int exp msgid, string exp
 tagname1[, string exp tagname2...]);

checktype
1 - check all tagname1 tags to make sure that they contain nothing other than tagname2, tagname3, etc. and no other elements
flags (when checktype is 1)
1 - display appropriate error messages if needed
2 - tagname1 tags must directly contain at least one of the allowed elements; if a message is generated due to this flag, then the message id used will be msgid+1 unless msgid is -1
4 - the msgid is only for messages caused by flag 2 (1 will not be added to msgid in this case); messages caused by flag 1 will not have a message ID
8 - check only the last child of the current node (good to use in end tag name programs)
16 - after msgid, include a string to prepend to any displayed messages
32 - only check to make sure that tagname1 tags directly contain at least one of the allowed elements (sets flag 2 and does not display error messages for tags used that are not listed as an allowed tag in the function parameters); returns 1 or greater (indicating which allowed element was used) if an allowed element is used
Default return value is 0
2 - returns 1 if the last child of the current node contains a "th" element (does not look in "td" elements), else returns 0; DO NOT SUPPLY ANY PARAMETERS OTHER THAN checktype
msgid - the message ID to use if any messages are generated; use -1 for no message ID
This function is implemented only in CSE HTML Validator Std/Pro v5.9910 and later.

int checkTagUsed(int exp flags, int exp returntype,
 string exp isopentag[, string exp tagname1,
 string exp tagname2...]);

flags
1 - display the default error message if all tagnames have not been used after isopentag
2 - use the start tag for the last closed tag instead of isopentag; do not supply the isopentag parameter if using this flag
4 - don't consider the last added component when searching for any tagnamex
8 - before isopentag, specify a tag, excludetag, so that if tagnamex is contained in excludetag, then it is as if that occurrence of tagnamex did not occur; do not use with flag 16
16 - when using this flag, specify an integer, numexcludetags, after flags to specify the number of excludetagx's that will be specified before isopentag; this flag is similar to flag 8, but allows you to specify more than one excludetag; do not use with flag 8
32 - display an warning message if no tagnamex's are supplied and no tags are found after isopentag; if any tag is found, no message is displayed; use with flag 1 (good to use in a end tag name program to generate an error message if the tag that was closed contains no tags - example: checkTagUsed(39, $RETURN_NOTUSED);)
64 - immediately after flags, specify a string to prepend to any message that is generated
128 - if a tag name is found, save the tag name in the variable checktagusedtagname (New v4.5091)
256 - if a tag name is found, save the tag name's structure ID number in the variable checktagusedtagnameid (New v4.5091)
512 - if isopentag is opened, save the line number that it was opened in in the variable checktagusedopenlinenum (New v4.5091)
Order for specifying additional parameters after flags: 16, 64
This function's return value depends on returntype:
If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
If returntype is $RETURN_LISTINDEX, then the return value is 0 if isopentag is not open, 1 if isopentag is open but no tagnamex has been used, and 2 or greater if isopentag is open and any tagnamex has been used. If the value is 2 or greater, then the return value indicates the first tagnamex in the list that has been opened after isopentag.
tagnamex - a tag name to check to see if it has been used after the last, still opened, isopentag; tagnamex is only checked to see if it has been used if isopentag is open
If no tagnamex tags are supplied, then any tag after isopentag in the document structure is considered to match tagnamex; if a match is made then returns 2
This function is implemented only in CSE HTML Validator Std/Pro v4.50 and later.

int Message(int exp display, int exp messagetype,
 string exp message[, location exp location]);

display - if nonzero, then the message is displayed; if zero (0), then the message is not displayed
messagetype - the type of message to display
$MSGBOX_INFORMATION - displays a standard windows information dialog box on the display; returns 1
$MSGBOX_ERROR - displays a standard windows error dialog box on the display; returns 1
$MSGBOX_WARNING - displays a standard windows warning dialog box on the display; returns 1
$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; returns 1
$MSG_WARNING - adds a warning message to the message output of the validator; returns 1
$MSG_COMMENT - adds a comment message to the message output of the validator; returns 1
$MSG_MESSAGE - adds a general message to the message output of the validator; returns 1
message - the actual message string 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_*.
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.

int MessageEx(int exp flags[, int msgid (use flag 4)],
 int exp messagetype[, string exp category (see flag 8)],
 string exp 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 (New v4.9920)
4 - following the flags parameter is an integer which is the message's unique ID number (New v5.4930)
8 - message has no category; do not supply the category parameter (New v5.4930)
16 - message is an accessibility message to be displayed in the Accessibility tab of the integrated editor (New v5.9910)
32 - message is a "priority 1" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
64 - message is a "priority 2" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
128 - message is a "priority 3" accessibility message (automatically sets flag 16) to be displayed in the Accessibility tab of the integrated editor (New v5.9930)
256 - if in standards compliant mode then upgrade messagetype to $MSG_ERROR (New v6.5020)
512 - message was generated by HTML Tidy (New v6.9941)
1024 - display message, overriding virtually any option or situation that would normally disable it (flag 1 must still be set to display the message) (New v7.0000)
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 - put message at the very top (New v8.9940)
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; returns 1
$MSGBOX_ERROR - displays a standard windows error dialog box on the display; returns 1
$MSGBOX_WARNING - displays a standard windows warning dialog box on the display; returns 1
$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; returns 1
$MSG_WARNING - adds a warning message to the message output of the validator; returns 1
$MSG_COMMENT - adds a comment message to the message output of the validator; returns 1
$MSG_MESSAGE - adds a general message to the message output of the validator; returns 1
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 string 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_*.
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.
This function is implemented only in CSE HTML Validator Std/Pro v4.50 and later.

int playSound(string exp filename[, int exp options])

Plays the sound file filename asynchronously.
options - can be added together (options is optional)
1 - play sound asynchronously (defaults to playing synchronously)
2 - play sound using soundplayer.exe included with CSE HTML Validator (other options may have no effect); allows sound to continue playing even after HTML Validator terminates
Returns 1 if successful, else returns 0.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

int requireAllAttributes(int exp flags,
 string exp att1[, string exp att2...]);

flags
1 - display a default error message if one of the listed attributes is not used
2 - immediately after flags, include a string to prepend to the default error message (requires flag 1) (New v4.5000)
4 - immediately after flags (unless flag 2 is used), specify that attribute that creates the requirement (requires flag 1) (New v4.9910)
8 - immediately after flags (unless flag 2 or 4 is used), specify a message ID (New v5.9930)
attx - an attribute
This function returns 0 if all of the listed attributes are used, or returns 1 or greater if one or more of the listed attributes are not used:
The function returns 1 or greater if one or more of the listed attributes are not used. For instance, 1 is returned if the first listed attribute is not used (att1), 2 if the second (att2), and so on. If more than one of the listed attributes is not used, then the return value indicates the first attribute in the list that is not used.
If the return value is 1 or greater, and flag 1 is set, then a standard error message will be generated stating that the tag requires all of the listed attributes.
Functionality change in CSE HTML Validator Std/Pro v4.50 and later: display has been replaced with flags

int requireMutuallyExclusiveAttributes(int exp
 display, int exp returntype,
 string exp att1[, string exp att2...]);

display - if nonzero, then a default error message is displayed if more than one of the listed attributes are used, if zero (0), then the default error message is not displayed
attx - an attribute
This function returns -2 if none of the listed attributes are used, -1 if more than one of the listed attributes is used, and 1 or greater if exactly one of the listed attributes is used:
If returntype is $RETURN_LISTINDEX, then the function returns 1 or greater if exactly one of the listed attributes is used. For instance, 1 is returned if the first listed attribute is used (att1), 2 if the second (att2), and so on. If more than one attribute is used, the return value is -1.
If returntype is $RETURN_ATTINDEX, then the function returns 1 or greater if exactly one of the listed attributes is used. The return value is the index of the used attribute. If more than one attribute is used, the return value is -1.
If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
If the return value is -1, and display is nonzero, then a standard error message will be generated stating that the tag requires listed attributes to be mutually exclusive.

int requireOneAttribute(int exp flags, int exp returntype,
 string exp att1[, string exp att2...]);

flags
1 - display a default error message if none of the listed attributes are used
attx - an attribute
This function returns -1 if none of the listed attributes are used, else the function returns 1 or greater:
If returntype is $RETURN_LISTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. For instance, 1 is returned if the first listed attribute is used (att1), 2 if the second (att2), and so on. If more than one attribute is used, then the return value indicates the first attribute used in the list.
If returntype is $RETURN_ATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute. If more than one attribute is used, then the return value is the index of the attribute that appears first in the list.
If returntype is $RETURN_FIRSTATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute that appears first in the tag and is anywhere in the list, and not necessarily the index of the attribute that is in the tag and appears first in the list.
If returntype is $RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.
If the return value is -1, and flags&1 is 1, then a standard error message will be generated stating that the tag requires at least one of the listed attributes.
Functionality change in CSE HTML Validator Std/Pro v5.00 and later: display has been replaced with flags.

int runProgram(int exp programnum[, int exp programnum...]);

Runs a built in "tag name program". Built-in tag name programs help to improve performance because the program is precompiled and can be written more efficiently.
programnum
1 - run built in text tag name program, returns 0 if successful or a negative number if an error occurs
2 - run built in end tag name program for the "p" element, returns 0 if successful or a negative number if an error occurs (New v4.5091)
3 - run for "alt" attributes to check for alt text containing only white space characters and to generate appropriate accessibility messages if so (New v5.9910)
4 - run an attribute program that checks the attribute's value for possibly misspelled words (New v4.5091)
5 - run for "alt" attributes to check alt text for beginning with inappropriate strings like "click here", "go to", "image of", and "link to" and to generate appropriate accessibility messages if so (New v5.9910)
6 - run for "alt" attributes to check for inappropriate alt text like "image", "picture", and "alt text" and to generate the appropriate accessibility messages if so (New v5.9910); also checks for common image file extensions like ".jpg" (New v7.9911)
7 - run for "alt" attributes to check for alt text longer more than 75 characters and to generate the appropriate accessibility messages if so (New v5.9910); also checks for alt text shorter than 8 characters (New v7.9910)
8 - run a tag name program that checks if the element's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the tag should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5093)
9 - run for elements that provide programmatic functions (like "applet", "script", and "object") and generate appropriate accessibility messages about making sure that the page is usable without these these programmatic functions (New v5.9910)
10 - run for device-dependent event handlers like "onmouseout" and "onmouseover" and generate appropriate accessibility messages about using logical event handlers instead (New v5.9910)
11 - run for "frame" and "iframe" elements to check the "title" attribute for inappropriate titles and to generate appropriate accessibility messages (New v5.9910)
12 - run for "a" element to check the "href" attribute for "javascript:" and to generate appropriate accessibility messages (New v5.9910)
13 - displays appropriate accessibility style sheet messages when a style sheet is used (New v5.9910)
14 - displays appropriate accessibility messages about using style sheets (CSS) instead of presentational HTML/XHTML markup (New v5.9910)
15 - displays an accessibility message about ordering heading elements properly (the message is displayed only once) (New 20030130)
16 - run a tag name program that checks if the attribute's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the attribute should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5110)
17 - run in the "coords" attribute tag name program to check the value of the "coords" attribute (New v5.9910)
18 - run in "headers" attribute program to check the "headers" attribute value; table cell IDs must be stored in an array named "$tablecellidusedarray" (New v5.9910)
19 - run in the "accesskey" attribute program(s) to check for duplicate accesskey values (New v5.9910)
20 - run at end of the validation to check for the use of labels with form controls such as "input", "select", and "textarea" (New v5.9930)
21 - run in tag name programs to place the current tag's attributes and attribute values in the node structure because they may be needed later (New v5.9930)
22 - checks $contentvalue for a valid robot meta tag content value; sets $runprogram22result with results ("" if OK, or other if not) (New v6.0100)
23 - run in tag name close programs (like for the "a" tag) to generate warning messages when the tag does not contain any text (special treatment for "a" tags: works only for "a" tags with the "href" attribute and that don't contain tags like "img") (New v6.4930)
24 - run in tag name programs to check attribute values (for attributes like "width", "height", "hspace", and "vspace") for CSS length units and print an appropriate message if CSS length units are improperly used in HTML attribute values (New v6.4930)
25 - run in tag name programs to check for HTML 4 attributes incorrectly being used in XHTML documents (like the "for" and "event" attributes for the "script" element) (New v6.4930)
26 - run in attribute programs to check the attribute value for mismatched single or double quotes; good for checking event attributes like "onclick" (New v6.4940)
27 - run for elements that may be in a form to check to see if the element has a "name" attribute value that may cause problems/conflicts with JavaScript, such as "action", "method", "name", "target", etc. (New v6.4940)
28 - run in the start validation program (New v6.4950)
29 - run in the end tag programs for elements that may only contain inline elements when the document is a strict or XHTML 1.1 document. (New v6.5200)
30 - run in the end tag programs for elements that may only contain block elements when the document is a strict or XHTML 1.1 document. (New v6.5200)
31 - run in the "tabindex" attribute program(s) to check for duplicate tabindex values (New v6.5200)
32 - adds $value (excluding "#") to $internallinksarray and increments $numinternallinks if $value is not already in the array (New v4.5200)
33 - run in the "a" open program to check for an adjacent "a" tag with only whitespace between the current "a" tag and the adjacent "a" tag (accessibility checking) (New v6.5300)
34 - run in the "table" end tag to check the table structure by checking that each table row has the same number of cells (works even when "colspan" and "rowspan" attributes are used)
35 - run at the end of a validation to check for block level elements contained in inline elements; runs if flag 28 or 30 is set; flag 30 is specific for finding block level elements contained in a "font" element (New v6.9931)
36 - run in the end tag program for empty tags like "br" and "img"; generates a warning message if the end tag for an empty element is encountered in an XHTML document (New v6.9941)
37 - add any refresh links contained in a meta refresh tag to the list of document links; in v8.9910 and above, also sets $runprogram37url to the link to refresh to (New v7.0005)
38 - run at the end of a validation to generate warning messages for tags that don't contain text but probably should (like "b", "i", "label", header tags, etc); also generates a message for empty "p" tags (New v7.9910)
39 - run at the end of a validation to display a comment message that lists ignored CSS properties (if any) (New v7.9910)
40 - check the value of the "id" attribute for valid characters; generates special messages for values beginning with _asp, __asp, or underscores (New v7.9914)
41 - check image dimensions (if able) and generate a message if actual image dimensions are different from that specified with the "height" and/or "width" attributes; in v9.0192 and above, generates a warning if one "height" or "width" attribute value is a percent and the other is not (New v8.9910)
42 - use in an end tag program to check the text contents of the element being closed for preceding space characters (New v8.9910)
43 - run in "option" tag program to check the "value" attribute's value for a possible link to check with the link checker (New v8.9910)
44 - run in an attribute program to check the attribute value for tags and generate a warning if tags are found (New v9.0191)
64 - if tag name program flag 11 is set, plays a sound according to how many errors and warnings (if any) are present (New v5.00)
128 - program to handle validation modes (New v5.00)
256 - run in onConfigLoad() function (New v5.00)
512 - run for non-XHTML 1.1 and non-HTML 4.0x strict tags (New v5.02)
1024 - run for XHTML 1.0 strict, XHTML 1.1 and HTML 4.0x strict tags that may contain non-XHTML 1.0 strict, non-XHTML 1.1 or non-HTML 4.0x strict attributes (New v5.02)
2048 - run in the attribute program for non XHTML 1.1 and HTML 4.0x attributes (New v5.4930)
4096 - run in the tag name close program for the "a" element that checks to see if the contents is something like "click here", if so, displays a style message (New v5.4930); also checks for Internet addresses (like http://www.domain.com) in link descriptions and generates a style message if found because readers may try to pronounce them (New v5.9920)
8192 - generate an error message if the tag is nested within itself; use in a tag name open program (New v5.4930)
16384 - check for "height" and "width" attributes that have percents as values and display a message about potential issues (New v5.4940)
32768 - for end tag name programs; displays a warning message if the contents of the tag does not begin with <!--; good to run for the "style" and "script" tag name close programs (New v5.4940)
65536 - run for tags that might contain deprecated XHTML attributes (New v5.4940)
131072 - run for tags that must be contained in an inline or block element in strict XHTML 1.0, XHTML 1.1, or XHTML Basic documents (New v5.4950)
262144 - run for attributes that may have browser specific color values (like UI color names); displays a message about them (New v5.5000)
524288 - run to check "width" attributes that specify widths greater than 100% and to display compatibility messages about using widths greater than 100% (New v5.5100)
1048576 - run to check "src" attributes that specify BMP images (with a .bmp file extension) and to display a message about BMP compatibility if a BMP image is specified (New v5.5100); as of v7.9910, this program will also display a compatibility message for PNG images
Returns 0 if programnum is unknown or HTML Validator doesn't know how to handle it. An error message will not be generated.
Functionality change in CSE HTML Validator Std/Pro v4.5091 and later: flags has been replaced with programnum.
Functionality change in CSE HTML Validator Std/Pro v5.4950 and later: accepts multiple programnums separated by commas.
Do not use the runProgram() function unless you completely understand what you are doing.
This function is implemented only in CSE HTML Validator Std/Pro v4.50 and later.

int setFlag(int exp flagset, int exp flag, int exp value);

flagset - the set of flags where flag is contained
1 - CSECFGVALFLAGS1
2 - CSECFGVALOUTPUTFLAGS
3 - CSECFGVALENTITYFLAGS
4 - CSECFGGENFLAGS
5 - CSECFGNETFLAGS
6 - CSECFGTOOLFLAGS
7 - CSECFGLOGFLAGS
8 - CSECFGTAGNAMEPROGRAMFLAGS; flag is the tag name program flag number (includes style flags)
9 - CSECFGVALFLAGS2
10 - CSECFGTIDYFLAGS
11 - CSECFGNSGMLSFLAGS
12 - CSECFGPHPFLAGS (New v8.9910)
13 - CSECFGJSFLAGS (New v8.9910)
14 - CSECFGSEARCHENGINEFLAGS (New v8.9910)
50 - "\Validator\ValidatorFlagsxx" (CSECFGVALFLAGS1), flag ignored, set all flags at once (New v4.5010)
51 - "\Validator\OutputFlagsxx" (CSECFGVALOUTPUTFLAGS), flag ignored, set all flags at once (New v4.5010)
52 - "\Validator\EntityFlagsxx" (CSECFGVALENTITYFLAGS), flag ignored, set all flags at once (New v4.5010)
53 - "\General\Flagsxx" (CSECFGGENFLAGS), flag ignored, set all flags at once (New v4.5010)
54 - "\Network\Flagsxx" (CSECFGNETFLAGS), flag ignored, set all flags at once (New v4.5010)
55 - "\Tools\Flagsxx" (CSECFGTOOLFLAGS), flag ignored, set all flags at once (New v4.5010)
56 - "\Logging\Flagsxx" (CSECFGLOGFLAGS), flag ignored, set all flags at once (New v4.5010)
60 - "\Validator\ProgramFlagsxx" (tag name program flags 1-30), flag ignored, set all flags at once (New v4.5010)
61 - "\Validator\ProgramFlags2xx" (tag name program flags 31-60), flag ignored, set all flags at once (New v4.5010)
62 - "\Validator\ProgramFlags3xx" (tag name program flags 61-90), flag ignored, set all flags at once (New v4.5010)
63 - "\Validator\ProgramFlags4xx" (tag name program flags 91-120), flag ignored, set all flags at once (New v4.5010)
64 - "\Validator\ProgramFlags5xx" (tag name program flags 121-150), flag ignored, set all flags at once (New v4.5010)
65 - "\Validator\ProgramFlags6xx" (tag name program flags 151-180), flag ignored, set all flags at once (New v4.5010)
70 - "\Validator\CSSCheckerFlags" (style flags 600-629), flag ignored, set all flags at once (New v6.4930)
71 - "\Validator\CSSCheckerFlags2" (style flags 630-659), flag ignored, set all flags at once (New v6.4930)
200 - CSERESULTSTATUSFLAGS (New v4.5000)
300 - Validator job flags (New v6.9941)
flag values
1 - disable CSE validation results (use in start validation program)
2 - ignore "cf" elements (those that begin with "cf") (New v8.01)
3 - PHP script detected in document (New v8.9910)
4 - JavaScript detected in document (New v8.9910)
flag - the flag to set or read; a bitmask unless otherwise noted
value - the new value of the flag; 1 to set the flag, 0 to clear the flag, and anything else, such as -1, to read the flag (the function returns the flag's value)
The function returns the original value of the flag (0 or 1) before it was changed (if it was changed).
flagsets 50-69 allow one to easily override most or all of the checkbox options in the Validator Engine Options for a given configuration file. To use these flagsets, set up the Validator Engine Options the way that you want and then press the Save Now button to save the options to the registry. You can then use the Registry Editor to view the values of certain registry entries. Use these values and the setFlag() function in the start validation tag name program of the configuration file to override the user's currently selected Validator Engine Options. For example, in CSE HTML Validator Std/Pro v8.0, set up the Validator 2 tab of the Validator Engine Options the way that you want, press the Save Now button, then go to the Registry Editor to get the value for "ValidatorFlags40" in "HKEY_CURRENT_USER\Software\AI Internet Solutions\CSE HTML Validator v4\Validator DLL\Validator". Let's say this value is 1057088279. Now you can override most or all of the Validator 2 tab of the Validator Engine Options by adding this line to the start validation tag name program of the configuration file that you want modify: setFlag(50,0,1057088279);.
This function is implemented only in CSE HTML Validator Std/Pro v4.00 and later.

int setFlagEx(int exp flagset, int exp flag,
 int exp arg1, int exp value);

flagset - what to set
1 - set an attribute value option
flag - further specifies which flag to set
1 - enable attribute value program
arg1 - the attribute value ID
2 - set an attribute flag (New v6.4950)
flag - further specifies which flag to set
1 - attribute value contains no character references so don't try to convert them
2 - don't check the case of the attribute name (New v7.9914)
arg1 - the attribute index
value - 0 (false) or nonzero (true)
The function returns the original value of the flag (0 or 1) before it was changed (if it was changed).
Returns -1 if any arguments are not supported. An error message will not be generated.
This function is implemented only in CSE HTML Validator Std/Pro v5.00 and later.

int setInt(string exp name, int exp value);'

name - the name of the variable being created or changed; must follow the rules for variable names
value - the integer value to set the variable to
Returns value.
The variable name is created if it doesn't exist. If it already exists, the value of the variable becomes value.

int setPriority(int priority);

Changes the priority of CSE HTML Validator.
priority - can be one of the following
1 - low priority
2 - normal priority
3 - high priority
Returns nonzero if successful, else returns 0.
This function is implemented only in CSE HTML Validator Std/Pro v3.04 and later.

int setValueInt(int exp valueidentifier, int exp value);

valueidentifier - tells the function which value to set
value - what to set the value to
1 - sets configflags of the configuration, value is ORed with configflags, for value:
1 - configuration supports CSEJOBTYPELINKCHECK
2 - sets the flag to use for the message "found the character '>' with no previous matching '<' to open the tag..."
3 - ORs doctypeflags with value; also see 8 (New v5.4930)
4 - sets the flag to use for the error message that is generated when a tag is "quick closed" in an HTML document when it would cause possible compatibility issues. (New v5.4930)
5 - limit messages to those with the value flag set; can be called repeatedly to limit messages to multiple flags; for example, setValueInt(5,2) will limit messages to accessibility messages (New v5.9910)
6 - sets valjobflags, value is ORed with valjobflags, for value (New v6.4930):
1 - standands compliant check - changes some functions to be more standards compliant
7 - set legacyflag, the flag that controls the display of legacy validator messages; when this flag is enabled, legacy messages are NOT displayed  (New v7.9910)
8 - sets doctypeflags to value; also see 3 (New v9.0201)
20 - sets CSEJOBSUBTYPE
Returns -1 if an error occurs, such as if valueidentifier is invalid. This function will not generate a validator error message if it returns -1 because valueidentifier is invalid.
If valueidentifier is valid, returns the old value of valueidentifier.
This function is implemented only in CSE HTML Validator Std/Pro v4.5091 and later.

int errorcode writeFile(string exp filename,
 string exp varname[, int exp flags]);

Writes the contents of varname to filename and returns errorcode. This function is useful for logging purposes. If varname is an array, then writes the entire array.
errorcode (return value)
1 - no error, but did not do anything because this function is not supported in the lite edition.
0 - normal operation (should have succeeded)
-1 - could not open filename
-2 - varname does not exist
flags
1 - append to the end of filename instead of overwriting it
2 - treat varname as the actual string to write and not as a variable name
It is most efficient to use this function in the end validation program to write a multi-line array (created using addValue()) to a file instead of writing each line to a file with multiple calls to writeFile()
New line characters are automatically appended to each line that is written to the file.
This function is implemented only in CSE HTML Validator Std/Pro v7.01 and later.