VMS Help
PASCAL, Predeclared Routines, Transfer
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Transfer routines convert an actual parameter to data of another
type.
The CHR function returns a char value whose ordinal value in the
ASCII character set is the parameter, provided such a character
exists.
Syntax:
CHR( x )
The parameter 'x' must be integer or unsigned and have a value
from 0 to 255.
The DBLE function converts the parameter and returns its DOUBLE
equivalent.
Syntax:
DBLE( x )
The parameter 'x' must be of an arithmetic type. The value of
'x' must not be too large to be represented by a
double-precision number.
The INT64 function converts the parameter and returns its
INTEGER64 equivalent.
Syntax:
INT64(x)
Overflow can occur and is detected at runtime if overflow
checking is enabled and the value of 'x' is outside the range of
INTEGER64.
The INT function converts the parameter and returns its INTEGER
equivalent.
Syntax:
INT(x)
Overflow can occur and is detected at runtime if overflow
checking is enabled and the value of 'x' is outside the range of
INTEGER.
The ORD function returns an integer value that is the position
of the parameter in the ordered sequence of values of the
parameter's type.
Syntax:
ORD( x )
The parameter 'x' must be of an ordinal type. Note that the
ordinal value of an INTEGER object is the integer itself. If
'x' is of type UNSIGNED, its value must not be greater than
MAXINT.
The PACK procedure copies components of an unpacked array
variable to a packed array variable.
Syntax:
PACK( a,i,z )
The parameter 'a' is an unpacked array. The parameter 'i' is a
value to indicate the starting value of the index of 'a'. The
parameter 'z' is a packed array of the same component type as
'a'.
The number of components in parameter a must be greater than or
equal to the number of components in 'z'. The PACK procedure
assigns the components of 'a', starting with a[i], to the array
'z', starting with z[lower bound], until all the components in
'z' are filled.
In general, when specifying 'i', keep in mind that the upper
bound of a (that is, n) must be greater than or equal to i + v -
u, where 'v' is the upper bound of 'z' and 'u' is the lower
bound of 'z'. That is, ORD(n) must be greater than or equal to
ORD(i) + ORD(v) - ORD(u).
The QUAD function converts the parameter and returns its
QUADRUPLE equivalent.
Syntax:
QUAD( x )
The parameter 'x' must be of an arithmetic type.
The ROUND function converts the value of the parameter by
rounding the fractional part of the value, and returns its
integer equivalent.
Syntax:
ROUND( x )
The parameter 'x' must be of type REAL, SINGLE, DOUBLE, or
QUADRUPLE. The value of 'x' must not be too large to be
represented by an integer.
The SNGL function converts the parameter and returns its real
equivalent.
Syntax:
SNGL( x )
The parameter 'x' must be of an arithmetic type. The value of
'x' must not be too large to be represented by a
single-precision number.
The TRUNC function converts the value of the parameter by
truncating the fractional part of the value and returns its
integer equivalent.
Syntax:
TRUNC( x )
The parameter 'x' must be of type REAL, SINGLE, DOUBLE, or
QUADRUPLE. The value of 'x' must not be too large to be
represented by an integer.
The UINT function converts the value of the parameter and
returns its unsigned equivalent.
Syntax:
UINT( x )
The parameter 'x' must be of an ordinal type.
No error results if 'x' is an integer and has a negative value.
The value returned is x MOD 2**32.
The UINT64 function converts the value of the parameter and
return its UNSIGNED64 equivalent.
Syntax:
UINT64(x)
The parameter 'x' must be of an ordinal type.
No error results if 'x' is an integer and has a negative value.
The value returned is x MOD 2**64.
The UNPACK procedure copies components of a packed array to an
unpacked array variable.
Syntax:
UNPACK( z,a,i )
The parameter 'z' is a packed array. The parameter 'a' is an
unpacked array variable. The parameter 'i' is the starting
value of the index of 'a'.
The number of components in 'a' must be greater than or equal to
the number of components in 'z'. The UNPACK procedure assigns
the components of 'z', starting with z[lower bound], to the
array 'a', starting with a[i], until all the components in 'z'
are used.
In general, when specifying 'i', keep in mind that the upper
bound of 'a' (that is, n) must be greater than or equal to i + v
- u, where 'v' is the upper bound of 'a' and 'u' is the lower
bound of 'a'. That is, ORD(n) must be greater than or equal to
ORD(i) + ORD(v) - ORD(u).
Normally, you cannot pass the individual components of a packed
array to formal VAR parameters; you must unpack the array first.
The UROUND function converts the value of the parameter and
returns its unsigned equivalent by rounding the fractional part
of the value.
Syntax:
UROUND( x )
The parameter 'x' must be of type REAL, SINGLE, DOUBLE, or
QUADRUPLE.
No error results if the value of 'x' is negative or greater than
4,294,967,295. In that case, the unsigned result is the rounded
parameter value MOD 4,294,967,296.
The UTRUNC function converts the parameter and returns its
unsigned equivalent by truncating the fractional part of the
value.
Syntax:
UTRUNC( x )
The parameter 'x' must be of type REAL, SINGLE, DOUBLE, or
QUADRUPLE.
No error results if the value of 'x' is negative or greater than
4,294,967,295. In that case, the unsigned result is the
truncated parameter value MOD 4,294,967,296.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.