Caché ObjectScript Reference
$ZDASCII
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Converts an eight-byte string to a $DOUBLE floating point number.
Synopsis
$ZDASCII(string,position)
$ZDA(string,position)
Parameters
string A string. It can be a value, a variable, or an expression. It must be a minimum of eight bytes in length.
position Optional — A starting position in the string, expressed as a positive integer. The default is 1. Position is counted in single bytes, not eight-byte strings. The position cannot be the last byte in the string, or beyond the end of the string. A numeric position value is parsed as an integer by truncating decimal digits, removing leading zeros and plus signs, etc.
Description
The value that $ZDASCII returns depends on the parameters you use.
$ZDASCII can return either a positive or a negative number.
$ZDASCII issues a <FUNCTION> error if string is of an invalid length, or position is an invalid value.
Example
The following example determines the numeric interpretation of the character string "abcdefgh":
  WRITE $ZDASCII("12345678")
It returns: .0000000000000000000000000000000000000682132005170133
The following examples also return the same value:
  WRITE !,$ZDASCII("12345678",1)
  WRITE !,$ZDASCII("12345678xx",1)
  WRITE !,$ZDASCII("xx12345678xx",3)
Notes
$ZDASCII and Other $ASCII Functions
$ZDASCII converts a eight byte (64-bit) character string to an IEEE floating point number. $ZQASCII converts a eight byte (64-bit) character string to an integer. To convert an 8-bit byte string to an integer use $ASCII. To convert a 16-bit (wide) character string to an integer use $ZWASCII. To convert a 32-bit (long) character string to an integer use $ZLASCII.
See Also