That can't be. It would become an infinite for loop for i=3D0. Shahid -----Original Message----- From: Frank [mailto:fuzzoli@COMCAST.NET]=20 Posted At: Wednesday, January 14, 2004 5:36 PM Posted To: PICList Conversation: [OT:] C to VB conversion Subject: Re: [OT:] C to VB conversion In addition, also add a 'step' to the 'for j...' loop. 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.MIT.EDU] On Behalf Of Sergio Masci Sent: Wednesday, January 14, 2004 6:40 AM To: PICLIST@MITVMA.MIT.EDU 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. Regards Sergio Masci -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.