15,894,825 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 HAOYE850815 (Top 5 by date)
HAOYE850815
2-Nov-11 17:13pm
View
Sorry, I am not fully understand- what is the answer number?
HAOYE850815
2-Nov-11 16:47pm
View
Actually I programmed the event for myself. The entry condition is all right when I have tested. Could you please tell if you can find any problems on the events, particularly the register. Is there any problem if I write two events using one same delegate.many thanks for your reply
HAOYE850815
2-Nov-11 16:35pm
View
I am so sorry, It is a typo mistake. I have changed it.
Could you please help me to have a look the event registration? I am not sure why only one event triggered. It bothered me for several days. Many thanks.
HAOYE850815
28-Feb-11 6:12am
View
Hello SA,
Thanks for your reply. Actually what I want is to split the string of $GNGGA data into different substrings, and then extract the usful information(some substrings in this string).
But i found that, because the split method split strings into many substrings and stored line by line, with 0-based index. If I tried to display it in Console Program, it is all right like StreamReader sr = new StreamReader("data1.txt");
string data = sr.ReadToEnd();
string[] lineArr = data.Split('$');
for (int i = 0; i < lineArr.Length; i++)
{
string strTemp = lineArr[i];
string[] words = strTemp.Split(',');
if (words[0] == "GPGGA")
{
try
{
Console.WriteLine(words[1]);
Console.WriteLine(words[2]);
Console.WriteLine(words[4]);
}
catch
{
}
}
}
but the situation is changed if i want to output into WindowsForm TextBox, I used anther function to packed this data processing
private static double GetLat (string sentence)
{
string[] words = sentence.Split(',');
foreach (string s in words)
{
double latitude = Convert.ToDouble(s[2]);
}
return latitude;
}
to split the strings and output the THIRD value, it doesn't work and always break like "Index was outside the bounds of the array". I understand this possibly a simple problem, but it really disturbed me for a few days. can you provide any more suggestions or usful code explanations? Many thanks.
HAOYE850815
8-Feb-11 9:30am
View
Hello Andrew, thanks for your reply. I changed the code as what you said. But the situation is the program is stopped without any reaction. I am not sure, it still no data on the textBox?
// open the serial port
port->Open();
// create a file to write
String^ txt = port->ReadLine(); StreamWriter^ sw = gcnew StreamWriter("GPSdata.txt");
//TextBox1->Text += txt + "\r\n";
while (( txt = port->ReadLine())!= nullptr)
{
//String^ txt = port->ReadLine();
//sw->WriteLine(txt);
TextBox1->Text += txt + "\r\n";
sw->WriteLine(txt);
sw->Flush();
}
//sw->Close();