Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LRC - Longitudinal Redundancy Check?
Message
 
 
To
12/07/2002 16:30:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00678269
Message ID:
00678301
Views:
15
>Can anyone give me example code on doing LRC on a string?
>

IIRC, the LRC character is a result of XOR of each byte of the string.
lcStr = "LRC - Longitudinal Redundancy Check"
lnLRC = 0
FOR i=1 TO len(lcStr)
	lnLRC = BITXOR(lnLRC, ASC(SUBSTR(lcStr,i ,1) ))
ENDFOR

? lnLRC 
lcLRC = CHR(lnLRC)
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform