Method
Converts a BCD number to the absolute value of the number.
Category
BCD
Syntax
Sub BcdAbs(ByVal hBcd As Long)
hBcd
The handle to the BCD number.
Example
hBCD = CF1.AllocBcd
tmpLong = -1
tmpLong2 = 1
CF1.LongToBcd tmpLong, hBCD
CF1.BcdAbs (hBCD)
tmpVar = CF1.BcdToLong(hBCD)
If CLng(tmpVar) = Abs(tmpLong) Then
CF1.LongToBcd tmpLong2, hBCD
CF1.BcdAbs (hBCD)
tmpVar = CF1.BcdToLong(hBCD)
If CLng(tmpVar) = Abs(tmpLong2) Then
logWr "BcdAbs OK"
Else
logWr "BcdAbs failed with -1"
End If
Else
logWr "BcdAbs failed with 1"
End If
CF1.FreeBcd hBCD
Comments
BcdAbs converts the BCD number referred to by hBcd to the absolute
value of that number.