Cvd Function

Purpose

Converts the first eight characters in a string from binary to IEEE double format.

Syntax

double = Cvd(a$ [,offset%])

Description

Cvd() convert eight characters of a string into the IEEE Double format. Cvd() returns 0, if the length of the string is smaller than eight characters.

Example

OpenW 1

Local a$, a%, b$, c$, d$, e$

Open "Test.dat" for Random As # 1, Len = 21

Field # 1, 1 As a$, 4 As b$, 4 As c$, _

4 As d$, 8 As e$

a$ = Chr$(123)

b$ = Mki$(1234)

c$ = Mkl$(12345678)

d$ = Mks$(1.23)

e$ = Mkd$(1.23)

Put # 1, 1

Get # 1, 1

Print Asc(a$)`Cvi(b$)`Cvl(c$)`Cvs(d$)`Cvd(e$)

// Prints: 123 1234 12345678 1.23 1.23

Remarks

Cvd() is the reverse function of Mkd().

See Also

Mkd$()

{Created by Sjouke Hamstra; Last updated: 27/09/2014 by James Gaite}