Revision [16534]

This is an old revision of KeyPgCvi made by CountingPine on 2013-01-22 15:42:42.



Converts a single-precision floating-point number or four-byte string to an integer variable

result = Cvi( sng )
result = Cvi( str )

A KeyPgSingle Single floating-point number with a binary copy of an integer variable stored in it.
A KeyPgString String at least four bytes in length with a binary copy of an integer variable stored in it.

Return Value:
An KeyPgInteger integer variable to copy the binary copy of a integer to.

Returns a 32-bit KeyPgInteger Integer value using the binary data contained in a KeyPgSingle Single, or a KeyPgString String of at least four bytes in length. A value of zero (0) is returned if the string is less than four bytes in length.
Cvi is used to convert 4-byte strings created with KeyPgMki Mki.
This function can also be used to convert 32-bit integer values from a memory or file buffer without the need for a KeyPgType Type structure. However, just as with the type structure, special care should be taken when using Cvi to convert strings that have been read from a buffer.

Dim i As Integer, s As String
i = &H44434241
s = MKI(i)
Print Using "i = _&H&"; Hex(i)
Print Using "s = ""&"""; s

Dialect Differences:
Differences from QB:
See also:
Back to String Functions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki phatcode