Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help decoding function
Message
De
23/12/2004 07:45:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Help decoding function
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
00971747
Message ID:
00971747
Vues:
62
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform