Method
Converts a string to a BCD number.
Category
BCD
Syntax
Sub StrToBcd(ByVal Number As String, ByVal hBcd As Long)
Number
The number that is to be converted.
hBcd
The handle to the BCD number.
Example
hBCD = CF1.AllocBcd
tmpStr = "42"
CF1.StrToBcd tmpStr, hBCD
tmpVar = CF1.BcdToStr(hBCD)
If tmpStr <> CStr(tmpVar) Or VarType(tmpVar) <> vbString Then
logWr "BCDToStr or StrToBCD failed"
Else
logWr "BCDToStr and strToBCD OK"
End If
CF1.FreeBcd hBCD
Comments
StrToBcd converts the string in Number to a BCD number. The result
is stored in the BCD number that is referenced by hBcd.