Private Sub MSComm1_OnComm()
Dim InBuff As String
Select Case MSComm1.CommEvent
'Nedanstående händelser utlöses när motsvarande
'fel inträffar i COM-porten
' Errors
Case comEventBreak
InBuff = "comEventBreak"
Call WriteComm(InBuff)
Case comEventCDTO
InBuff = "comEventCDTO"
Call WriteComm(InBuff)
Case comEventCTSTO
InBuff = "comEventCTSTO"
Call WriteComm(InBuff)
Case comEventDSRTO
InBuff = "comEventDSRTO"
Call WriteComm(InBuff)
Case comEventFrame
InBuff = "comEventFrame"
Call WriteComm(InBuff)
Case comEventOverrun
InBuff = "comEventOverrun"
Call WriteComm(InBuff)
Case comEventRxOver
InBuff = "comEventRxOver"
Call WriteComm(InBuff)
Case comEventRxParity
InBuff = "comEventParity"
Call WriteComm(InBuff)
Case comEventTxFull
InBuff = "comEventTxFull"
Call WriteComm(InBuff)
Case comEventDCB
InBuff = "comEventDCB"
Call WriteComm(InBuff)
' Events
Case comEvCD
InBuff = "Change in the CD line."
Call WriteComm(InBuff)
Case comEvCTS
InBuff = "Change in the CTS line."
Call WriteComm(InBuff)
Case comEvDSR
InBuff = "Change in the DSR line."
Call WriteComm(InBuff)
Case comEvRing
InBuff = "Change in the Ring Indicator."
Call WriteComm(InBuff)
Case comEvReceive
InBuff = MSComm1.Input
Call WriteComm(InBuff)
Case comEvSend
InBuff = "Det finns SThreshold antal bokstäver i buffern."
Call WriteComm(InBuff)
Case comEvEOF
InBuff = "En EOF sträng hittades."
Call WriteComm(InBuff)
End Select
End Sub