IBM Books

Reference

DTW_URLESCSEQ


AIX HP-UX Linux OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X X

Purpose

Replaces selected characters not allowed in a URL with their escape values, known as URL-encoded codes.

Format

@DTW_URLESCSEQ(stringIn, stringOut)

@DTW_rURLESCSEQ(stringIn)

Parameters

Table 53. DTW_URLESCSEQ Parameters

Data Type Parameter Use Description
string stringIn IN A variable or literal string.
string stringOut OUT A variable containing the input string with characters that are not allowed in URLs that are replaced with their hexadecimal escape values.

Return Codes

Table 54. DTW_URLESCSEQ Return Codes

Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1003 The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function.
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

Use this function to pass any of the characters listed in Table 55 to another macro or HTML block.

Table 55. Character Escape Values for URLs

Character Name Code
SPACE Space %20
" Double quote %22
# Number sign %23
% Percent %25
& Ampersand %26
+ Plus %2B
\ Backslash %2F
: Colon %3A
; Semicolon %3B
< Less than %3C
= Equals %3D
> Greater than %3E
? Question mark %3F
@ At sign %40
[ Left bracket %5B
/ Slash %5C
] Right bracket %5D
^ Carat %5E
{ Left brace %7B
| Straight line %7C
} Right brace %7D
~ Tilde %7E

Examples

Example 1: Replaces the space and an ampersand characters in string1 with their escape values and assigns the result to string2

@DTW_URLESCSEQ(string1,string2)

Example 2: Replaces space and ampersand characters with their escape codes.

@DTW_rURLESCSEQ("Guys & Dolls")

Example 3: Uses DTW_rURLESCSEQ in a ROW block, and replaces space and 'at' characters with their escape codes.

%ROW{
<P><a href="fullRpt.mac/input?name=@DTW_rURLESCSEQ(V1)&email=@DTW_rULRESCSEQ(V2)">
$(V1)</a>
%}

When the application user clicks on the name "Patrick O'Brien," the values specified for the name and e-mail address flow within the query string of the URL that causes Net.Data to execute the input section of the fullrpt.mac macro.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]