AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Deletes a substring of a string from the nth character for length characters.
Format
@DTW_DELSTR(stringIn, n, length, stringOut)
@DTW_DELSTR(stringIn, n, stringOut)
@DTW_rDELSTR(stringIn, n, length)
@DTW_rDELSTR(stringIn, n)
Parameters
Table 80. DTW_DELSTR Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | stringIn | IN | A variable or literal string. |
integer | n | IN | The position of the character at which the substring to delete begins. If n is greater than the length of stringIn, stringOut is set to the value of stringIn. |
integer | length | IN | The length of the substring to delete. The default is to delete all characters to the end of stringIn. |
string | stringOut | OUT | A variable that contains the modified form of stringIn. |
Return Codes
Table 81. DTW_DELSTR Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1001 | An input parameter contained a NULL value. |
1002 | An input parameter contained a string value which consisted of the null-terminating character. |
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. |
1007 | A parameter contains a value which is not valid. |
Examples
Example 1:
@DTW_DELSTR("abcde", "3", "2", result)
Example 2:
@DTW_rDELSTR("abcde", "4", "1")