BcdSgn

Method
Returns the sign of a BCD number.

Category
BCD

 

Syntax
Function BcdSgn(ByVal hBcd As Long) As Long

hBcd
The handle to the BCD number.

 

Example

hBCD = CF1.AllocBcd

  tmpLong = 0

  tmpLong2 = -1

  CF1.LongToBcd tmpLong, hBCD

  tmpVar = CF1.BcdSgn(hBCD)

  If CLng(tmpVar) = Sgn(tmpLong) And VarType(tmpVar) = vbLong Then

  CF1.LongToBcd tmpLong2, hBCD

  tmpVar = CF1.BcdSgn(hBCD)

  If CLng(tmpVar) = Sgn(tmpLong2) And VarType(tmpVar) = vbLong Then

  tmpLong = 1

  CF1.LongToBcd tmpLong, hBCD

  tmpVar = CF1.BcdSgn(hBCD)

  If CLng(tmpVar) = Sgn(tmpLong) And VarType(tmpVar) = vbLong Then

  logWr "BcdSgn OK"

  Else

  logWr "BcdSgn failed with 1"

  End If

  Else

  logWr "BcdSgn failed with -1"

  End If

  Else

  logWr "BcdSgn failed with 0"

  End If

  CF1.FreeBcd hBCD

 

Comments
BcdSgn returns the sign of the BCD number hBcd:

If the Number Is:

BcdSgn Returns:

> 0

1

< 0

-1

0

0



© 2009 Microsoft Corporation. All rights reserved.