To define your own function, add a function to the functions program type in the following format:

function functionname() { statement; ... [return [exp];] }

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

Use return [exp]; to return from a function with an optional value. (New v11.9910)

NOTE: Currently, all variables are global and no function parameters are allowed. For example, function fname($arg1) is not allowed.

NOTE: In versions prior to CSE HTML Validator v11, the keyword function must begin at the first character of a line and the preceding '@' character before the function name is required when calling functions. In versions prior to CSE HTML Validator v12, the keyword return is not allowed (and thus functions cannot return values).