-
May 29th, 2007, 03:35 PM
#1
Best way to parse a large string
Hi, im pretty new to C# and i need your opinions on whats the best ( efficient and professional way to the below function )
I have a large message ( lets say, 58 charactaters coming over TCP/IP once every second, they are temperature values )
i have also the same number of custom controls ( lets say labels ).
my GUI displays such values, and updates everysecond.
I know its a simple parsing, thats why i need your opinions on how to tackle this.
1) Should i convert the message into a large string so i can access the members by its array index?
2) Should i create Class and parse all those numbers to variable members within the class
3) How about the mapping? should i hard code the mapping, or should i read the mapping ( char[0] = temp1, char[2] = temp 3, etc etc ) from a file or external source.
4) should i write this function to run on its own thread?
Any other ideas? any input would be greatly appreciated. This is for work and i dont want to come out as rookish at the peers code review meeting.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|