Method
Compares two BCD numbers.
Category
BCD
Syntax
Function BcdCmp(ByVal hLeftBcd As Long, ByVal hRightBcd As Long) As
Long
hLeftBcd
The handle to the first (Left) BCD number.
hRightBcd
The handle to the second (Right) BCD number.
Example
hBCD = CF1.AllocBcd
hBCD2 = CF1.AllocBcd
tmpLong = 6
tmpLong2 = 3
CF1.LongToBcd tmpLong, hBCD
CF1.LongToBcd tmpLong2, hBCD2
tmpVar = CF1.BcdCmp(hBCD, hBCD2)
If VarType(tmpVar) = vbLong And CLng(tmpVar) = 1 Then
logWr "BcdCmp OK"
Else
logWr "BcdCmp failed"
End If
CF1.FreeBcd hBCD
CF1.FreeBcd hBCD2
Comments
BcdCmp compares the two BCD numbers hLeftBcd and hRightBcd. The
return values are:
If: |
BcdCmp Returns: |
Left > Right |
1 |
Left < Right |
-1 |
Left = Right |
0 |