Click here to Skip to main content
15,884,298 members

Comments by Member 13936585 (Top 7 by date)

Member 13936585 24-Aug-18 8:28am View    
Thanks buddy
Member 13936585 24-Aug-18 7:58am View    
Thanks. I still couldn't sort it out. can you please write it for me.
Member 13936585 24-Aug-18 5:52am View    
Private Sub OnDataAvailable(ByVal result As IAsyncResult)
If Not _bDisconnecting Then

Try
Dim nRead As Integer = _tcpStream.EndRead(result)

If nRead > 0 Then
_strBuffer += Encoding.ASCII.GetString(_readBuffer, 0, nRead)
_logStream.Write(_readBuffer, 0, nRead)
Dim [end] As Integer = 0

While [end] >= 0 AndAlso Not _bDisconnecting
'//Ignore leading /r/n
Dim nIgnore As Integer = 0

While (nIgnore < _strBuffer.Length AndAlso (_strBuffer(nIgnore) = '\r' OrElse _strBuffer(nIgnore) = '\n' ))
nIgnore += 1
End While

[end] = _strBuffer.IndexOf("\r\n", nIgnore)

If [end] >= 0 Then
Dim sRx As String = _strBuffer.Substring(nIgnore, [end] + 2)

If _strBuffer.Length > [end] + 2 Then
_strBuffer = _strBuffer.Substring([end] + 2)
Else
_strBuffer = ""
End If

If HandleReply(sRx) Then AppendLog("Rx: " & sRx)
End If
End While
End If
'//Setup the Async Read again for the next data received.
If Not _bDisconnecting Then _tcpStream.BeginRead(_readBuffer, 0, 256, New AsyncCallback(AddressOf OnDataAvailable), Nothing)
Catch __unusedException1__ As Exception
End Try
End If
End Sub

can you please help me in above code- in the line, While (nIgnore < _strBuffer.Length AndAlso (_strBuffer(nIgnore) = '\r' OrElse _strBuffer(nIgnore) = '\n' ))

it says expression expected at = '\r' and I tried everything but it won't accept. It supposed to be simple equal sign. any help will be much appreciated. That code is to write a logfile.
Member 13936585 20-Aug-18 5:42am View    
Thanks a lot buddy. Really appreciate your help. Yes you are right It updates both values in horizontal text box and never updates Vertical position in vertical text box. I will try what you explained and update you. Have good day :)
Member 13936585 20-Aug-18 4:55am View    
Deleted
Thanks for your advice.