Compaq AA-PWCBD-TE Computer Accessories User Manual


 
DEC Text Processing Utility Data Types
3.10 Range Data Type
The following example assigns a value of the range data type to the variable x:
x := CREATE_RANGE (mark1, mark2, UNDERLINE);
You can specify the video attribute with which DECTPU should display a range.
The possible attributes are BLINK, BOLD, REVERSE, and UNDERLINE. The
UNDERLINE keyword in the preceding example specifies that the characters
in the range will be underlined when they appear on the screen. You cannot
give more than one video attribute to a range. However, to apply multiple video
attributes to a given set of characters, you can define more than one range that
contains those characters and give one video attribute to each range.
3.11 String Data Type
DECTPU uses the string data type to represent character data. A value of the
string data type can contain any of the elements of a character set. You can select
one of the following character sets to use with your string data:
DEC_MCS—DEC Multinational Character Set
ISO_LATIN1—ISO Latin1 Character Set
GENERAL—Other general character sets
DECTPU uses the string data type to represent character data. A value of the
string data type can contain any of the elements of the character sets mentioned
previously. To specify a string constant, enclose the value in quotation marks. In
DECTPU, you can use either the quotation mark (
" ) or the apostrophe ( ) as the
delimiter for a string. The following statements assign a value of the string data
type to the variable x:
x := ’abcd’;
x := "abcd";
To specify the quote character itself within a string, type the character twice
if you are using the same quote character as the delimiter for the string. The
following statements show how to quote an apostrophe and a quotation mark,
respectively:
x := ’’’’; ! The value assigned to x is ’.
x := """"; ! The value assigned to x is ".
If you use the alternate quote character as the delimiter for the string within
which you want to specify a quote character, you do not have to type the
character twice. The following statements show how to quote an apostrophe and
a quotation mark, respectively, when you use the alternate quote character to
delimit the string:
x := "’"; ! The value assigned to x is ’.
x := ’"’; ! The value assigned to x is ".
A null string is a string of length zero. You can assign a null string to the
variable x in the following way:
x:=’;
To create a string from the contents of a range, use the STR or the SUBSTR
built-in procedure. To create a string from the contents of a buffer, use the STR
built-in.
3–20 DEC Text Processing Utility Data Types