When you inquire about a segment, the value returned is the string containing the contents of the specified segment. For example, if the source textual region Speech contained the following:
and the following response statement is invoked:
response to Speech
copy textual segment column 5 line 1
thru column 11 line 3 from Speech to Excerpt
the following string would be copied to the string variable Excerpt:
"quick\nbrown fox\njumped over"
When the insert STRING drawing statement (described earlier in this chapter) contains the built-in function textual segment and it is used with a colored textual region, it drops any character-oriented color information from the inserted segment. For example, in the following statement, any color attributes in the segment are retained.
response to ...
add to ColoredNewText
# The following inserts a segment
# with color attributes:
insert segment column 25 line 6
thru column 16 line 7 from ColoredOldText
But in the following statement, any color attributes are dropped, and the segment is drawn in the foreground and background colors of the textual region ColoredNewText.
response to ...
add to ColoredNewText
# The following inserts a string returned by the
# textual segment function. Color attributes are
# dropped:
insert textual segment column 25 line 6
thru column 16 line 7 from ColoredOldText