AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Encodes selected characters using HTML character escape codes.
Format
@DTW_HTMLENCODE(stringIn, stringOut)
@DTW_rHTMLENCODE(stringIn)
Parameters
Table 41. DTW_HTMLENCODE Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | stringIn | IN | A variable or literal string. |
string | stringOut | OUT | A variable containing the modified input string in which certain characters have been replaced by the HTML character escape codes. |
Return Codes
Table 42. DTW_HTMLENCODE Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1003 | An incorrect number of parameters were passed on a function call. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1006 | A literal string was passed on a function call for a parameter which was required to be an output parameter. |
Usage Notes
Table 43. Character Escape Codes for HTML
Character | Name | Code |
SPACE | Space |   |
" | Double quote | " |
# | Number sign | # |
% | Percent | % |
& | Ampersand | & |
[ | Left bracket | ( |
] | Right bracket | ) |
+ | Plus | + |
\ | Slash | / |
: | Colon | : |
; | Semicolon | ; |
< | Less than | < |
= | Equals | =: |
> | Greater than | >: |
? | Question mark | ?: |
@ | At sign | @ |
/ | Backslash | \ |
^ | Carat | ^ |
{ | Left brace | { |
| | Straight line | | |
} | Right brace | } |
~ | Tilde | ~ |
Examples
Example 1: Encodes the space character
@DTW_HTMLENCODE(string1,string2)
Example 2: Encodes spaces, the less-than sign, and the equal sign
@DTW_rHTMLENCODE("X <= 10")