Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function CommRead(intPortID As Integer, strData As String, _
- lngSize As Long) As Long
- Dim lngStatus As Long
- Dim lngRdSize As Long, lngBytesRead As Long
- Dim lngRdStatus As Long, strRdBuffer As String * 1024
- Dim lngErrorFlags As Long, udtCommStat As COMSTAT
- On Error GoTo Routine_Error
- strData = ""
- lngBytesRead = 0
- DoEvents
- ' Clear any previous errors and get current status.
- lngStatus = ClearCommError(udtPorts(intPortID).lngHandle, lngErrorFlags, _
- udtCommStat)
- If lngStatus = 0 Then
- lngBytesRead = -1
- Cells(8, 1).Value = lngBytesRead
- lngStatus = SetCommError("CommRead (ClearCommError)")
- GoTo Routine_Exit
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement