mscomm data converting

S

Thread Starter

scotty625

How do I extract the real data from mscomm buffer?
I have a device that sends data (0-255) to my PC, and I need to load it into a varible so as to use it to move a cursor. Works fine if I load b1 with a number.

comm input bit

Private Sub MSComm1_OnComm()
With MSComm1
Dim B1 As Integer
Select Case .CommEvent
' Event messages.
Case comEvReceive
B1 =(MSComm1.Input)
Highlight (B1)
End Select
End With
End Sub

Can anyone help?

cursor bit

Private Function Highlight(BoxNum As Integer)
'Use boxnum 0 to remove all highlights
For i = 1 To 256
If i <> BoxNum Then
txtCell(i).BackColor = vbYellow 'White
Else
txtCell(i).BackColor = vbRed 'RGB(255, 180, 180)
End If
Next i
End Function

I just keep getting "Type Mismatch".
 
Top