That's a typo! Sorry=2E Should read: for ( crc =3D i << 8 , j =3D 0 ; j < 8 ; j +=3D 1 ) I had to retype the source from a =2Epdf=2E /Hugo >>-----Original Message----- >>From: fuzzoli@COMCAST=2ENET [mailto:fuzzoli@COMCAST=2ENET] >>Sent: Wednesday, January 14, 2004 1:50 PM >>To: PICLIST@MITVMA=2EMIT=2EEDU >>Subject: Re: [OT:] C to VB conversion >> >>In addition, also add a 'step' to the 'for j=2E=2E=2E' loop=2E >> >>C Code: for ( crc =3D i << 8 , j =3D 0 ; j < 8 ; j +=3D i ) <=3D=3D=3D=3D >>Incrementing by ***i*** >> >>VB Code: For j =3D 0 To 7 Step i >> >>-Frank >> >>-----Original Message----- >>From: pic microcontroller discussion list >>[mailto:PICLIST@MITVMA=2EMIT=2EEDU] On Behalf Of Sergio Masci >>Sent: Wednesday, January 14, 2004 6:40 AM >>To: PICLIST@MITVMA=2EMIT=2EEDU >>Subject: Re: [OT:] C to VB conversion >> >> >>> And my feeble VB attempt: >>> >>> Option Explicit >>> Dim C16(255) As Long >>> >>> Sub CRC_Init() >>> Dim i As Long, j As Long >>> Dim crc As Long >>> For i =3D 0 To 255 >>> crc =3D i * 256 >>> For j =3D 0 To 7 >>> If crc >=3D &H8000 Then >>> crc =3D (crc * 2) Xor &H1021 >>> Else >>> crc =3D (crc * 2) Xor 0 >>> End If >> >>crc =3D crc AND &hffff >> >>> Next j >>> C16(i) =3D crc >>> Next i >>> End Sub >> >>I think the above is correct, try it and see=2E >> >>Regards >>Sergio Masci >> >>-- >>http://www=2Epiclist=2Ecom hint: The PICList is archived three different >>ways=2E See http://www=2Epiclist=2Ecom/#archives for details=2E >> >>-- >>http://www=2Epiclist=2Ecom hint: The PICList is archived three different >>ways=2E See http://www=2Epiclist=2Ecom/#archives for details=2E >> >> -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.