NET/MASTER Network Control Language (NCL) Reference Manual
OVERLAY
Built-in Functions
106126 Tandem Computers Incorporated 4–65
C
specifies that
new
is centered and padded to the left and right using the
character specified as
pad2
. If
pad2
is not specified, then
pad
is used.
pad2
specifies the pad character to be used for padding
new
. If omitted, the character
specified as
pad
is used.
Considerations
If
start
and
len
are not supplied, overlaying takes place from the first character
position of the target string for the length of
new
. If
new
and
target
are null
strings, a null string is returned.
See also SUBSTR, which extracts a substring from a string.
Examples
In the following example, the string “AAA” overlays the string “bbbbb”. Because a
start position is not specified, the overlay begins at character position 1. The output
string is “AAAbb”:
&A = AAA
&B = bbbbb
&RESULT = OVERLAY(&A,&B)
In the following example, the string “abcdefghijk” is overlayed by the new string 111.
The overlay begins at character position 1 for seven characters. The padding rules are
such that the new string is centered (C) within the length (7) of the original string. The
pad2
character is the asterisk (*). The output string is “**111**hijk”:
&A = 111
&B = abcdefghijk
&C = 1
&D = 7
&E = C
&F = "*"
&RESULT = OVERLAY(&A,&B,&C,&D,,&E,&F)