Copying substrings

A substring of an operand is copied by using the substring operand form.

The simplest form of the COPY action is copying an operand to a dictionary field value. For example:


COPY [2] {StreetName}

The substring operand only operates on standard operands or user variables. The form is:


COPY source(b:e) target

The b is the beginning column of the string and the e is the ending column. The following example copies the first character (1:1) of operand 2 to the street name field:


COPY [2](1:1) {StreetName}

The following example copies the second through fourth characters of the contents of the variable temp to the {StreetName} field:


COPY temp(2:4) {StreetName}

You can use a negative one (–1) to indicate the last character. A negative two (–2) indicates the next to last character, and so on. The following example copies the last three characters of operand 2 to the street name field:


COPY [2](-3:-1) {StreetName}