Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help decoding function
Message
From
23/12/2004 07:45:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Help decoding function
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00971747
Message ID:
00971747
Views:
61
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
Map
View

Click here to load this message in the networking platform