15,884,298 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Member 13936585
20-Aug-18 4:24am
View
Sorry for being away. I'm new to programming. Can you please help me or give me more hint of how I do that? reply of your comment- When the robot always sends both positions after a movement, that should also solve your problem with the changing horizontal value. With your code, the robots sends the horizontal value (100) first and is displayed. When it sends the vertical value (8) afterwards that will be wrongly put into the horizontal text box staying there until the next pair of positions is send.
Member 13936585
3-Aug-18 6:30am
View
Sorry for the long code. Thanks for your advice and I will cut it to appropriate sections where I need help.
Show More