STR
This built-in has two variants. One variant returns a string equivalent
for an integer, keyword, or string. The other variant returns the string
equivalent for the contents of a range or buffer.
Syntax 1
string1 := STR ({integer1 [, integer2]}
{keyword}
{string2} )
Returns the string equivalent for the integer, keyword, or string you
specify.
Parameters
integer1 The integer you want converted to a string.
integer2 The radix (base) you want DECTPU to use when
converting integer1 to a string. Allowable values
are 8, 10, and 16. The default radix is 10. You
can use integer2 only if you specify an integer as
the first parameter.
keyword The keyword whose string representation you want.
string2 A string you want returned. This built-in allows
a parameter of type string.
Syntax 2
string1 := STR ({range | buffer} [ [,string2] {, ON | OFF}] )
Parameters
range A range whose contents you want returned as a
string.
buffer A buffer whose contents you want returned as a
string.
string2 Specifies how you want line breaks represented.
The default is the null character. You can use
string2 only if you specify a range or buffer as
the first parameter. Every line break in the
buffer or range is replaced by the string you
specify. The end of the last line in the buffer
or range is not replaced by the string you
specify.
ON A keyword directing DECTPU to insert spaces to
preserve the white space created by left margins
greater than one in the buffer or range. No
spaces are inserted for lines that do not contain
characters. Integer 1 is equivalent to the
keywork ON.
OFF A keyword directing DECTPU to ignore left margins
when converting the buffer or range to a string.
Integer 0 is equivalent to the keywork OFF.
Examples
1. The following procedure converts two integer variables to strings so
the current column and row can be displayed in the message area:
PROCEDURE user_display_position
what_col := GET_INFO (current_window, "current_column");
what_row := GET_INFO (current_window, "current_row");
MESSAGE ("Column " + STR (what_col) + ", Row " + STR (what_row));
ENDPROCEDURE;
2. The following statement forms a string using the text in the range
"this_range"; in the string, each end of line is represented with the
string "<CR><LF>":
this_string := STR (this_range, "<CR><LF>");
For example, if the text in "this_range" was the following:
You make the best of
What's still around
then "this_string" would contain the following:
You make the best of<CR><LF>What's still around
Related topics
ASCII FAO INT SUBSTR