OVERWRITE
Finds and replaces a string in PTX records without changing the length of the record. This function performs a binary replace; arguments must be in the proper code page.
Note: OVERWRITE() is not valid in the "START:" or "FINISH:" sections.
Syntax
OVERWRITE(inputString, outputString, [count])
Arguments
Argument | Description | Default |
---|---|---|
inputString | The search string. | None |
outputString | The replacement string. | None |
[count] | How many times to replace on this page or document | 65535 |
Result
Result | Description | |
---|---|---|
Return | None | |
%%RC | One of the following: | |
0 | if function was successful | |
1 | if inputString is longer than outputString; input string will not be entirely replaced | |
2 | if outputString is longer than inputString; output string will not be entirely used | |
%%RM | A null string ('') | |
%%RV | Always set to 0 |
Examples
OVERWRITE(e'1999', e'2015', 1)
OVERWRITE(a2e(%%myoldString), a2e(%%mynewString))