MSComm question (1 Viewer)

jeppe

Registered User.
Local time
Today, 09:44
Joined
Jun 5, 2006
Messages
16
Private Sub MSComm1_OnComm()

Dim Buffer As String
Dim t1 As Single

Buffer = MSComm1.CommEvent
t1 = timer

Do Until Buffer = 2
If timer - t1 > 2 Then Exit Sub
Loop
Call AddScanRecords

End Sub

I use the code whit barcode scanner...Idea is take a barcode from com-port buffer when all barcode is received and call subroutine. If reading is failed then Exit sub.

Is this a good way handle the buffer?
 

Users who are viewing this thread

Top Bottom