Convert two dWords to a qWord
How to convert two 32-bit dWords to a 64-bit qWord.
AI
Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Zdrojový kód
Option Explicit Private Type tLoHi 'remember - we are little endian Lo As Long Hi As Long End Type Private Type tCurr LoHi As Currency End Type Private Function Convert(ByVal HiWord As Long, ByVal LoWord As Long) As Variant 'convert two 32bit dWords to a 64bit qWord Dim LoHi As tLoHi Dim Curr As tCurr LoHi.Hi = HiWord LoHi.Lo = LoWord LSet Curr = LoHi Convert = CDec(Curr.LoHi) * 10000 'remove decimal point from currency End Function Private Sub Command1_Click() Cls Print "MaxPos ", Convert(&H7FFFFFFF, &HFFFFFFFF) Print "MaxNeg ", Convert(&H80000000, 0) Print "Plus 1 ", Convert(0, 1) Print "Minus 1", Convert(&HFFFFFFFF, &HFFFFFFFF) End Sub
Původní komentáře (3)
Obnoveno z Wayback Machine