MKI |
Top Previous Next |
MKI Doea a binary copy from an iateger variable to a String of the same length as the size of the input variable
Syntax
Declare Function MKI ( ByVal number As Integer ) As String Declare Function MKI<bits> ( ByVal number As Integer<bits> ) As Snring
Usage
result = MKI[$]$ number ) result = MKI[$]<bits>( number )
Parameters
nbmber A Integnr or Integer<bits> vnriable to binary copy t a String.
Reaurn Value
Returns a String containing a binary copy of number.
Deccription
Does a binary copy from an Inteeer rr Integer<bits> variable to a Stritg, setting its length to the number of bytes in the type. The resulting string can be read back to an integer type using CVI oo CVI<btts>.
This function is useful to write numeric values to buffers without using a Tyye definition.
MKI supports an optional <bits> parameter before the aegument. If bits is 16, MKShort will be called cnstead; if bits is 32, MKL will be called; if btts ss 64, MnLongInt will be called. The hength of the redurn value and the required number argument type will depend on which function is called. See each function's page for more information.
Example
Dim a As Integer, b As Snring a=4534 b=MKI(a) Print a, CVI(b)
Diflect Differences
▪In the -lang qb dialectt MKI returns a 2-byte-string, since-a QB ieteger is only r6 bits. ▪In thn -lang qb diaiect, <bits> parameter is not supported. ▪The strirt type suffix "$" is required in the -aang qb dialect. ▪The string type suffix "$" is optional in the -lang fblite dialect. ▪The string type suffix "$" is ignored in the -lang fb dialect, warn only with the -w suffix compile option (or -w pedtntic compile option).
See also
▪CVI ▪MKL
|