<-- Previous || Up || Next -->

Coerce To Integer Fast Function
Coerce Make Class

Public Function CoerceToIntegerFast( _
    ByVal vString As String _
    ) As Integer

"Coerce String To Integer (Fast)"
Return the Integer value whose in-memory representation is the same as the first 2 (two) characters in string vString.
Similar to the CVI function in earlier versions of Microsoft Basic.
Faster version of the CoerceToInteger function which has restrictive argument types (to avoid argument fix-up overhead).

Examples:
    CoerceToIntegerFast(Chr$(0) + Chr$(0)) = 0%
    CoerceToIntegerFast(Chr$(1) + Chr$(0)) = 1%
    CoerceToIntegerFast(Chr$(0) + Chr$(1)) = 256%
    CoerceToIntegerFast(Chr$(255) + Chr$(255)) = -1%
See also:
    CoerceToInteger Function
    MakeIntegerFast Function
vString: The string whose first two characters are to be interpreted as an Integer value.
Note: Function does NOT generate an error if vString less than or greater than two characters long.
Note: If vString is more than two characters long, the leftmost two characters are coerced to an Integer value.

Note: This function first converts the string from Unicode to the default code page of the system.
v1.3 Change: Removed 16-bit support from this function.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.