A text segment is any set of contiguous characters within a textual region. You can copy a segment, use it to overwrite existing text, emphasize it, or remove it. The segment definition itself must appear within an insert or overwrite drawing statement.
In the definition, you specify integer values for the starting and ending column and line character positions for the segment. The segment includes the first and last character positions specified.
A segment can be defined by any two endpoints of the text, for example, first character through last, or last character through first. For example, if you specify:
response to ...
add to NewTxt
insert segment column 3 line 1 thru column 8 line 3
from OldTxt
or:
response to ...
add to NewTxt
insert segment column 8 line 3 thru column 3 line 1
from OldTxt
the following text from the textual region OldTxt will be inserted into the textual region NewTxt:
If you omit the column and line keywords, the first and third integer values always specify the column numbers, and the second and fourth integer values always specify the line numbers. For example:
response to ...
add to NewTxt
insert segment 3 1 thru 8 3 from OldTxt
Again, beginning and ending positions can be reversed. The above statement is equivalent to :
response to ...
add to NewTxt
insert segment 8 3 thru 3 1 from OldTxt
You can define a segment that contains character positions to the right of the last character in a line, as long as that line is not the last one in the textual region. For example, if you specify:
response to ...
add to NewTxt
insert segment column 10 line 3
thru column 10 line 5 from OldTxt
and the textual region OldTxt contains the following text:
the segment will begin at column 9, line 3 (the position following the last character in line 3), and end at column 6, line 5 (the position following the last character in line 5).
However, you cannot define a segment that contains character positions that begin and end anywhere after the last character in the last line of the textual region. If you attempt to do so, no segment is selected, and an error message is produced.
Note that in this and the following illustrations, the gray shaded box indicates the position of the text cursor.
For example, if you had specified:
response to ...
add to NewTxt
insert segment column 10 line 5
thru column 15 line 5 from OldTxt
an error message would have been generated, since the segment is after the last character in the last line of the textual region.
If thru is not specified - that is, if you provide only one set of column and line numbers - the segment will be a single character position.