BcdAbs

Method
Converts a BCD number to the absolute value of the number.

Category
BCD

 

Syntax
Sub BcdAbs(ByVal hBcd As Long)

hBcd
The h
andle 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.



© 2009 Microsoft Corporation. All rights reserved.