|
|
Updated:
11 December 1998
|
OpenVMS RTL General Purpose (OTS$) Manual
Part 2
OTS$ Reference Section
This section provides detailed descriptions of the routines provided by
the OpenVMS RTL General Purpose (OTS$) Facility.
OTS$CNVOUT
The Convert Floating to Character String routines convert a D-floating,
G-floating or H-floating number to a character string in the Fortran E
format.
Format
OTS$CNVOUT D-G-or-H-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction
OTS$CNVOUT_G D-G-or-H-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction
OTS$CNVOUT_H D-G-or-H-float-pt-input-val
,fixed-length-resultant-string ,digits-in-fraction (VAX only)
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
D-G-or-H-float-pt-input-val
OpenVMS usage: |
floating_point |
type: |
D_floating, G_floating, H_floating |
access: |
read only |
mechanism: |
by reference |
Value that OTS$CNVOUT converts to a character string. For OTS$CNVOUT,
the D-G-or-H-float-pt-input-val argument is the
address of a D-floating number containing the value. For OTS$CNVOUT_G,
the D-G-or-H-float-pt-input-val argument is the
address of a G-floating number containing the value. For OTS$CNVOUT_H,
the D-G-or-H-float-pt-input-val argument is the
address of an H-floating number containing the value.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string into which OTS$CNVOUT writes the character string result
of the conversion. The fixed-length-resultant-string
argument is the address of a descriptor pointing to the output string.
digits-in-fraction
OpenVMS usage: |
longword_unsigned |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Number of digits in the fractional portion of the result. The
digits-in-fraction argument is an unsigned longword
containing the number of digits to be written to the fractional portion
of the result.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
SS$_ROPRAND
|
Floating reserved operand detected.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|
OTS$CVT_L_TB
The Convert an Unsigned Integer to Binary Text routine converts an
unsigned integer value of arbitrary length to binary representation in
an ASCII text string. By default, a longword is converted.
Format
OTS$CVT_L_TB varying-input-value,fixed-length-resultant-string
[,number-of-digits] [,input-value-size]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference |
Unsigned byte, word, or longword that OTS$CVT_L_TB converts to an
unsigned decimal representation in an ASCII text string. (The value of
the input-value-size argument determines whether
varying-input-value is a byte, word, or longword.) The
varying-input-value argument is the address of the
unsigned integer.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
ASCII text string that OTS$CVT_L_TB creates when it converts the
integer value. The fixed-length-resultant-string
argument is the address of a descriptor pointing to this ASCII text
string. The string is assumed to be of fixed length (CLASS_S
descriptor).
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits in the binary representation to be generated.
The number-of-digits argument is a signed longword
containing this minimum number. If the minimum number of digits is
omitted, the default is 1. If the actual number of significant digits
is less than the minimum number of digits, leading zeros are produced.
If the minimum number of digits is zero and the value of the integer to
be converted is also zero, OTS$CVT_L_TB creates a blank string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing the byte size. This is an optional argument. If the size is
omitted, the default is 4 (longword).
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|
OTS$CVT_L_TI
The Convert Signed Integer to Decimal Text routine converts a signed
integer to its decimal representation in an ASCII text string. This
routine supports Fortran Iw and Iw.m output and BASIC output conversion.
Format
OTS$CVT_L_TI varying-input-value ,fixed-length-resultant-string
[,number-of-digits] [,input-value-size] [,flags-value]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference, fixed length |
A signed integer that OTS$CVT_L_TI converts to a signed decimal
representation in an ASCII text string. The
varying-input-value argument is the address of the
signed integer.
On VAX systems, the integer can be a signed byte, word, or longword.
The value of the input-value-size argument determines
whether varying-input-value is a byte, word, or
longword.
On Alpha systems, the integer can be a signed byte, word, longword, or
quadword. The value of the input-value-size argument
determines whether varying-input-value is a byte,
word, longword, or quadword.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor |
Decimal ASCII text string that OTS$CVT_L_TI creates when it converts
the signed integer. The fixed-length-resultant-string
argument is the address of a CLASS_S descriptor pointing to this text
string. The string is assumed to be of fixed length.
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits to be generated when OTS$CVT_L_TI converts the
signed integer to a decimal ASCII text string. The
number-of-digits argument is a signed longword
containing this number. If the minimum number of digits is omitted, the
default value is 1. If the actual number of significant digits is
smaller, OTS$CVT_L_TI inserts leading zeros into the output string. If
number-of-digits is zero and
varying-input-value is zero, OTS$CVT_L_TI writes a
blank string to the output string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing this value size. If the size is omitted, the default is 4
(longword).
On VAX systems, the value size must be 1, 2, or 4. If value size is 1
or 2, the value is sign-extended to a longword before conversion.
On Alpha systems, the value size must be 1, 2, 4, or 8. If the value is
1, 2, or 4, the value is sign-extended to a quadword before conversion.
flags-value
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Caller-supplied flags that you can use if you want OTS$CVT_L_TI to
insert a plus sign before the converted number. The
flags-value argument is an unsigned longword
containing the flags.
The caller flags are described in the following table:
Bit |
Action if Set |
Action if Clear |
0
|
Insert a plus sign (+) before the first nonblank character in the
output string.
|
Omit the plus sign.
|
If flags-value is omitted, all bits are clear and the
plus sign is not inserted.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. Either the result would have exceeded the
fixed-length string or the
input-value-size is not a valid value. The output
string is filled with asterisks (*).
|
OTS$CVT_L_TL
The Convert Integer to Logical Text routine converts an integer to an
ASCII text string representation using Fortran L (logical) format.
Format
OTS$CVT_L_TL longword-integer-value ,fixed-length-resultant-string
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
longword-integer-value
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by reference |
Value that OTS$CVT_L_TL converts to an ASCII text string. The
longword-integer-value argument is the address of a
signed longword containing this integer value.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string that OTS$CVT_L_TL creates when it converts the integer
value to an ASCII text string. The
fixed-length-resultant-string argument is the address
of a descriptor pointing to this ASCII text string.
The output string is assumed to be of fixed length (CLASS_S descriptor).
If bit 0 of longword-integer-value is set,
OTS$CVT_L_TL stores the character T in the rightmost character of
fixed-length-resultant-string. If bit 0 is clear, it
stores the character F. In either case, it fills the remaining
characters of fixed-length-resultant-string with
blanks.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is of zero length (descriptor
LENGTH field contains 0).
|
Example
|
5 !+
! This is an example program
! showing the use of OTS$CVT_L_TL.
!-
VALUE% = 10
OUTSTR$ = ' '
CALL OTS$CVT_L_TL(VALUE%, OUTSTR$)
PRINT OUTSTR$
9 END
|
This BASIC example illustrates the use of OTS$CVT_L_TL. The output
generated by this program is 'F'.
OTS$CVT_L_TO
The Convert Unsigned Integer to Octal Text routine converts an unsigned
integer to an octal ASCII text string. OTS$CVT_L_TO supports Fortran Ow
and Ow.m output conversion formats.
Format
OTS$CVT_L_TO varying-input-value ,fixed-length-resultant-string
[,number-of-digits] [,input-value-size]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference |
Unsigned byte, word, or longword that OTS$CVT_L_TO converts to an
unsigned decimal representation in an ASCII text string. (The value of
the input-value-size argument determines whether
varying-input-value is a byte, word, or longword.) The
varying-input-value argument is the address of the
unsigned integer.
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string that OTS$CVT_L_TO creates when it converts the integer
value to an octal ASCII text string. The
fixed-length-resultant-string argument is the address
of a descriptor pointing to the octal ASCII text string. The string is
assumed to be of fixed length (CLASS_S descriptor).
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits that OTS$CVT_L_TO generates when it converts
the integer value to an octal ASCII text string. The
number-of-digits argument is a signed longword
containing the minimum number of digits. If it is omitted, the default
is 1. If the actual number of significant digits in the octal ASCII
text string is less than the minimum number of digits, OTS$CVT_L_TO
inserts leading zeros into the output string. If
number-of-digits is 0 and
varying-input-value is 0, OTS$CVT_L_TO writes a blank
string to the output string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing the number of bytes in the integer to be converted by
OTS$CVT_L_TO. If it is omitted, the default is 4 (longword).
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. The result would have exceeded the
fixed-length string; the output string is filled with asterisks (*).
|
OTS$CVT_L_TU
The Convert Unsigned Integer to Decimal Text routine converts an
unsigned integer value to its unsigned decimal representation in an
ASCII text string.
Format
OTS$CVT_L_TU varying-input-value ,fixed-length-resultant-string
[,number-of-digits] [,input-value-size]
RETURNS
OpenVMS usage: |
cond_value |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by value |
Arguments
varying-input-value
OpenVMS usage: |
varying_arg |
type: |
unspecified |
access: |
read only |
mechanism: |
by reference |
An unsigned integer that OTS$CVT_L_TU converts to an unsigned decimal
representation in an ASCII text string. The
varying-input-value argument is the address of the
unsigned integer.
On VAX systems, the integer can be an unsigned byte, word, or longword.
(The value of the input-value-size argument determines
whether varying-input-value is a byte, word, or
longword.)
On Alpha systems, the integer can be an unsigned byte, word, longword,
or quadword. (The value of the input-value-size
argument determines whether varying-input-value is a
byte, word, longword, or quadword.)
fixed-length-resultant-string
OpenVMS usage: |
char_string |
type: |
character string |
access: |
write only |
mechanism: |
by descriptor, fixed length |
Output string that OTS$CVT_L_TU creates when it converts the integer
value to unsigned decimal representation in an ASCII text string. The
fixed-length-resultant-string argument is the address
of a descriptor pointing to this ASCII text string.
number-of-digits
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Minimum number of digits in the ASCII text string that OTS$CVT_L_TU
creates. The number-of-digits argument is a signed
longword containing the minimum number. If the minimum number of digits
is omitted, the default is 1.
If the actual number of significant digits in the output string created
is less than the minimum number, OTS$CVT_L_TU inserts leading zeros
into the output string. If the minimum number of digits is zero and the
integer value to be converted is also zero, OTS$CVT_L_TU writes a blank
string to the output string.
input-value-size
OpenVMS usage: |
longword_signed |
type: |
longword (signed) |
access: |
read only |
mechanism: |
by value |
Size of the integer to be converted, in bytes. The
input-value-size argument is a signed longword
containing this value size. If the size is omitted, the default is 4
(longword).
On VAX systems, the value size must be 1, 2, or 4.
On Alpha systems, the value size must be 1, 2, 4, or 8.
Condition Values Returned
SS$_NORMAL
|
Normal successful completion.
|
OTS$_OUTCONERR
|
Output conversion error. Either the result would have exceeded the
fixed-length string or the
input-value-size is not a valid value. The output
string is filled with asterisks (*).
|