Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculate LRC
Message
 
À
10/07/2007 13:08:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP
Divers
Thread ID:
01238986
Message ID:
01238988
Vues:
19
>How to calculate the LRC (Longitudinal Redundancy Check) in VFP 8.0?

For what I saw in Wikipedia http://en.wikipedia.org/wiki/Longitudinal_redundancy_check I suppose it should be something like:
? CalcLRC([some string])



FUNCTION CalcLRC(lcStr)
LOCAL lnRetVal, lnFor
lnRetVal = 0
FOR lnFor = 1 TO LEN(lcStr)
    lnRetVal = BITXOR(ASC(SUBSTR(lcStr, m.lnFor, 1)), lnRetVal)
NEXT
RETURN m.lnRetVal
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform