General information
Title:
Help decoding function
Can somebody help me in decoding a piece of code from VB to Visual Foxpro
I need to encode a normal numer like 20041010001 to a special code for a machine. The have given me the code for VB but i don't have and know VB.
Can someone help me?
Best regards,
Frits
FUNCTION convto36(strValue10 As String) As String
Dim varWrk As Variant
Dim varVal As Variant
Dim strResult As String
strResult = ""
varVal = CDec(strValue10)
Do While (varVal <> 0)
varWrk = ((varVal / 36) - Int(varVal / 36)) * 36
varVal = Int(varVal / 36)
varWrk = Int(varWrk + 0.5)
If (varWrk < 10) Then
strResult = Chr(Asc("0") + varWrk) & strResult
Else
strResult = Chr(Asc("A") + varWrk - 10) & strResult
End If
Loop
Tal10ToTal36 = strResult
ENDFUNC
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only