Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 38
Editing a Character String
Note that the data parameter contains the string to be edited on input and the edited
string on output.
Using the FIXSTRING Template
You can supply any of the following three commands in the FIXSTRING template:
R or r replaces characters in the string
D or d deletes characters in the string
I or i inserts characters in the string
The R or r command in the template causes all characters that follow the R or r
command to replace the corresponding characters in the string. The following example
shows use of the R command to replace text in the character string:
Note that the R command is implied if no other command is specified. For example,
the following template achieves the same result:
The implied replace command works only if the first character of the template is not a
command name (D, d, I, or i).
To delete characters in a string, the template must contain a D or d at the position
where you want a character deleted. For example:
To insert characters into a string, the template must contain an i or I character at the
corresponding character position, followed by the text to be inserted:
Before string: fup dup filea.fileb
Template: R,filec
After string: fup dup filea,filec
Before string: fup dup filea.fileb
Template: ,filec
After string: fup dup filea,filec
Before string: fup dup filea,fileb,filec
Template: DDDDDD
After string: fup dup filea,filec
Before string: fup filea,filec
Template: I dup
After string: fup dup filea,filec