Static Sub ShowData (Text1 As Control, DTA$) On Error Resume Next Dim Nd, I '--- Make sure the existing text doesn't get ' too large. Nd = Len(Text1.Text) If Nd >= 16384 Then Text1.Text = Mid$(Text1.Text, 4097) Nd = Len(Text1.Text) End If '--- Point to the end of Term's data Text1.SelStart = Nd '--- Filter/handle Back Space characters Do I = InStr(DTA$, Chr$(8)) If I Then If I = 1 Then Text1.SelStart = Nd - 1 Text1.SelLength = 1 DTA$ = Mid$(DTA$, I + 1) Else DTA$ = Left$(DTA$, I - 2) + Mid$(DTA$, I + 1) End If End If Loop While I '--- Elliminate Line Feeds (put back below) Do I = InStr(DTA$, Chr$(10)) If I Then DTA$ = Left$(DTA$, I - 1) + Mid$(DTA$, I + 1) End If Loop While I '--- Make sure all Charriage Returns have a ' Line Feed I = 1 Do I = InStr(I, DTA$, Chr$(13)) If I Then DTA$ = Left$(DTA$, I) + Chr$(10) + Mid$(DTA$, I + 1) I = I + 1 End If Loop While I '--- Add the filtered data to .Text Text1.SelText = DTA$ MSComm2.Output = DTA$ '--- Log data to file if requested If hLogFile Then I = 2 Do Err = 0 Put hLogFile, , DTA$ If Err Then I = MsgBox(Error$, 21) If I = 2 Then MSComm1.PortOpen = False End If End If Loop While I <> 2 End If End Sub