Hello,
can someone help me to transform a vb code to c#?
Dim res, res2, buffer(100) As Byte, tmp$, i
'read String[12] from DB1.DBB24..37, sizeof(string[12]) = 14 Bytes
res2 = daveReadBytes(dc, daveDB, 1, 24, 14, VarPtr(buffer(0)))
If res2 = 0 Then
For i = 0 To 13 'copy array of Byte to VB-String
tmp$ = tmp$ & Chr$(buffer(i))
Next i
'copy string payload into worksheet, STRING[12] from 3. byte, only actual length from 2. header byte
Worksheets("TEST").Range("B5") = Mid(tmp$, 3, buffer(1) Mod 13)
Else
Worksheets("TEST").Range("B5") = "error: " & daveStrError(res2)
Debug.Print "error: "; daveStrError(res2)
End If
can someone help me to transform a vb code to c#?
Dim res, res2, buffer(100) As Byte, tmp$, i
'read String[12] from DB1.DBB24..37, sizeof(string[12]) = 14 Bytes
res2 = daveReadBytes(dc, daveDB, 1, 24, 14, VarPtr(buffer(0)))
If res2 = 0 Then
For i = 0 To 13 'copy array of Byte to VB-String
tmp$ = tmp$ & Chr$(buffer(i))
Next i
'copy string payload into worksheet, STRING[12] from 3. byte, only actual length from 2. header byte
Worksheets("TEST").Range("B5") = Mid(tmp$, 3, buffer(1) Mod 13)
Else
Worksheets("TEST").Range("B5") = "error: " & daveStrError(res2)
Debug.Print "error: "; daveStrError(res2)
End If