hi, this function gives an "overflow" error 6 at random times, and i have no idea why!! plz give me some ideas
Private Sub MSComm1_OnComm()
If FlStart = True Then 'Button "Start" pressed
If MSComm1.InBufferCount >= 1 Then 'Input buffer is not empty
Ch = MSComm1.Input 'Read from the input buffer
InLine = InLine + Ch
'Check if end of line(CR+Lf) presents in string
If InStr(InLine, (Chr(13)) + (Chr(10))) > 0 Or InStr(InLine, (Chr(10)) + (Chr(13))) > 0 Then
'Update temporary log file with new data.
Open TempSaveName For Append As #1 'Open file
Print #1, InLine;
Close #1 'Close file
'Clean window every 10K to avoid memory issues
If Len(txtRx) >= 10000 Then
txtRx.Text = ""
End If
txtRx.Text = txtRx.Text + InLine
txtRx.SelStart = Len(txtRx)
InLine = ""
End If
End If
End If
End Sub
Private Sub MSComm1_OnComm()
If FlStart = True Then 'Button "Start" pressed
If MSComm1.InBufferCount >= 1 Then 'Input buffer is not empty
Ch = MSComm1.Input 'Read from the input buffer
InLine = InLine + Ch
'Check if end of line(CR+Lf) presents in string
If InStr(InLine, (Chr(13)) + (Chr(10))) > 0 Or InStr(InLine, (Chr(10)) + (Chr(13))) > 0 Then
'Update temporary log file with new data.
Open TempSaveName For Append As #1 'Open file
Print #1, InLine;
Close #1 'Close file
'Clean window every 10K to avoid memory issues
If Len(txtRx) >= 10000 Then
txtRx.Text = ""
End If
txtRx.Text = txtRx.Text + InLine
txtRx.SelStart = Len(txtRx)
InLine = ""
End If
End If
End If
End Sub