Function Windows API Class

CoerceTwoIntegersToLong

Coerce two Integer values into a Long (Integer) value. Return the Long value whose low-order word (2 bytes) has the same representation as vLo, and whose high-order word has the same representation as vHi. Inverse/opposite of the HIWORD and LOWORD functions.

Signature (Visual Basic / VBA)

Public Function CoerceTwoIntegersToLong( _
      ByVal vLo As Integer _
    , ByVal vHi As Integer _
    ) As Long

Code Example

    CoerceTwoIntegersToLong(1, 2) = 131073
    CoerceTwoIntegersToLong(2, 1) = 65538
    CoerceTwoIntegersToLong(0, 32767) = 2147418112
    CoerceTwoIntegersToLong(0, -32767) = -2147418112