CVD
Converts a 64-bit integer or 8-byte string to a double-precision value
Declare Function CVD ( ByVal l As LongInt ) As Double
Declare Function CVD ( ByRef str As Const String ) As Double
result = CVD( l )
result = CVD( str )
Does a binary copy from a 64-bit LongInt or 8-byte String to a Double variable. A value of zero (0.0) is returned if the string is less than 8 bytes in length. The result will make sense only if the parameter contained a IEEE-754 formatted double-precision value, such as one generated by CVLongInt or MKD.
This function is useful to read numeric values from buffers without using a Type definition.
Syntax
Declare Function CVD ( ByVal l As LongInt ) As Double
Declare Function CVD ( ByRef str As Const String ) As Double
Usage
result = CVD( l )
result = CVD( str )
Parameters
Return Value
Description
Does a binary copy from a 64-bit LongInt or 8-byte String to a Double variable. A value of zero (0.0) is returned if the string is less than 8 bytes in length. The result will make sense only if the parameter contained a IEEE-754 formatted double-precision value, such as one generated by CVLongInt or MKD.
This function is useful to read numeric values from buffers without using a Type definition.
Example
Dim d As Double, l As LongInt
d = 1.125
l = CVLongInt(d)
Print Using "l = _&H&"; Hex(l)
Print Using "cvd(i) = &"; CVD(l)
d = 1.125
l = CVLongInt(d)
Print Using "l = _&H&"; Hex(l)
Print Using "cvd(i) = &"; CVD(l)
Differences from QB
- QB did not support integer arguments.
See also