Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Richard Clarke
  Where is Richard Clarke?
 Minehead
 United Kingdom
 Richard Clarke
 Tags
Subject: Convert from C to VFP
Thread ID: 188183 Message ID: 188183 # Views: 63 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Other
Date: Thursday, August 07, 2008 10:57:34 PM         
   


Hi,

Can anyone convert this C code into VFP for me please? Looks like it is supposed to calculate a CRC16 checksum. I know the results it is supposed to give and i have to replicate it. Have tried sys( 2007) and the results are nothing like.


static unsigned int crc16(unsigned int val)
{
unsigned long crc=0,rip;
char c;

for (c=16; c ; c--){
rip=val^crc;
val>>=1;
crc>>=1;
if (rip & 1) crc ^= 0x11021; // polinomio ricavato da XLINK IAR
}
return crc;
}


Thanks in advance

Richard Clarke



COMPLETE THREAD
Convert from C to VFP Posted by Richard Clarke @ 8/7/2008 10:57:34 PM
RE: Convert from C to VFP Posted by Borislav Borissov @ 8/8/2008 8:34:00 AM
RE: Convert from C to VFP Posted by Richard Clarke @ 8/8/2008 9:49:20 AM
RE: Convert from C to VFP Posted by Borislav Borissov @ 8/8/2008 9:53:57 AM
RE: Convert from C to VFP Posted by Richard Clarke @ 8/8/2008 10:11:38 AM
RE: Convert from C to VFP Posted by Borislav Borissov @ 8/8/2008 11:04:23 AM
RE: Convert from C to VFP Posted by Richard Clarke @ 8/8/2008 4:13:19 PM
RE: Convert from C to VFP Posted by Anders Altberg @ 8/8/2008 6:44:37 PM