Private Sub MSComm1_OnComm() ' Linija 1 Static stEvent1 As String ' Storage for an Modem event Dim stComChar As String * 1 ' Temporary storage for received comm port data Select Case msComm1.CommEvent Case comEvReceive ' Received RThreshold # of chars. Do stComChar = msComm1.Input ' read 1 character .Inputlen = 1 Select Case stComChar Case vbLf ' Ignore linefeeds Case vbCr ' The CR indicates the end of the Receive String If Len(stEvent1) > 0 Then ProcessEvent1 stEvent1 ' Process the Modem event stEvent1 = "" End If Case Else stEvent1 = stEvent1 + stComChar ' Save everything between CR's End Select Loop While msComm1.InBufferCount ' Loop until all characters in receive buffer are processed End Select End Sub