hallo ich müsste folgendes umschreiben hab da ber so meine probleme das in Bascom Basic zu schreiben

fals mir da jemand mit rad helfen könnte .

es steht im Daten Blatt das man im übrigen den Bascom Basic-Befehl Crc8 zum bilden dieser Prüfsumme nutzen kann



Code:

Function Berechnecrc(s As String) As Byte
Dim J As Byte
Dim K As Byte
Dim Bcrc8 As Byte
Dim M As Byte
Dim X As Integer

Bcrc8 = 0

For M = 1 To Len(s)
  X = Asc(mid(s , M , 1))
  For K = 0 To 7
    J = 1 And(x Xor Crc8)
    Crc8 = Fix(crc8 / 2) And &HFF
    X = Fix(x / 2)and &HFF
    If J <> 0 Then
      Crc8 = Crc8 Xor &H8C
    End If
  Next K
Next
 Docrc8 = Crc8
End Function