Revision [16813]

This is an old revision of KeyPgCvi made by CountingPine on 2013-05-19 23:24:31.

 

CVI


Converts a single-precision floating-point number or string to an integer variable using a binary copy

Syntax:
Usage:
result = Cvi( sng )
result = Cvi( str )
result = Cvi<bits>( expr )

Parameters:
sng
A KeyPgSingle Single floating-point number with a binary copy of an integer variable stored in it.
str
A KeyPgString String with a binary copy of an integer variable stored in it.
bits
Specifies a size of integer type to return. The types and sizes of expr accepted will depend on the corresponding function called.
expr
An expression that will be copied into an KeyPgInteger Integer<bits>.

Return Value:
An KeyPgInteger Integer or KeyPgInteger Integer<bits> variable containing a binary copy of the input expression.

Description:
Returns an integer value using the binary data contained in a KeyPgSingle Single, or a KeyPgString String. A value of zero (0) is returned if the string contains fewer characters than the size of the return type.
Cvi is used to convert 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.
Cvi supports an optional <bits> parameter before the argument. If bits is 16, KeyPgCvshort Cvshort will be called instead; if bits is 32, KeyPgCvl Cvl will be called; if bits is 64, KeyPgCvlongint Cvlongint will be called. The return type and accepted argument types will depend on which function is called. See each function's page for more information.

Examples:
Dim i As Integer, s As String
s = "ABCD"
i = CVI(s)
Print Using "s = ""&"""; s
Print Using "i = _&H&"; Hex(i)


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



sf.net phatcode