What purpose is served by assigning a value to iNextChr in this statement? It looks like an equality test would be more appropriate.
Sorry, should have mentioned that this is Crestron Simpl+ programing (Their own version of C) so unlike most where it would normally be == it is only =, so it is in fact an equality test. Using == doesn't compile.
The second implementation would process each received character and then stop.
The first implementation would continue reading characters until it finds a 0x3B. If there is no 0x3B in the input stream, and the GetC() function doesn't return 0x3B when there is no more input, then the first implementation will loop forever appending whatever GetC() returns to the string.
PeterH:
Your termination conditions are different.
The second implementation would process each received character and then stop.
The first implementation would continue reading characters until it finds a 0x3B. If there is no 0x3B in the input stream, and the GetC() function doesn't return 0x3B when there is no more input, then the first implementation will loop forever appending whatever GetC() returns to the string.
I kind of thought that myself but the 0x3B is the terminating character for each incoming string, so it should stop at the end. Not to mention that after each comma, the Temp$ should be = ""
Jassper:
Like I said, there are a lot of good programmers here. But i see there a few dick's as well.
From one sarcastic remark you conclude that Nick is a bad programmer and a "few dick's"?
I can't tell if that is or is not an insult. It could be. But you incorrectly tried to make "dick" plural when referring to a single person. As written it is statement of what is before your eyes rather than an insult. From his published work, Nick is clearly a decent programmer which directly contradicts your implied mutual exclusion. Your statement makes no sense. You should rewrite it.
Maybe your post was meant to be sarcastic. Is that the case? Was your post an attempt at sarcasm?
If you have nothing to offer to the problem, then just don't replay. He didn't need to belittle, and your post is no better by trying to show your superiority by correcting my grammar and insinuations. Nicks reply was uncalled for just as mine was unfounded. Nick concluded from one post that I'm an Idiot so yes, I concluded from one sarcastic remark that Nick is a dick - seems fair.
The programing is C++ based, the basics are the same. My hope was that someone would have a "possible" reason. I wasn't asking someone to re-write the code in proper syntax - obviously that's not going to happen. PeterH and PaulS at least both offered something constructive and I think PeterH has come close. It at least confirmed that I was on the write track.
That's why I come here, because I get helpful information - regardless.
I never said you are an idiot. I doubt if you are.
I looked at your code for a while, trying to be helpful, but got stuck on this line:
until (iNextChr = 0x3B);
In C++ that would be almost certainly wrong, as that is assigning, not comparing. However clearly the code wasn't C (or C++) and you hadn't specified what it is. Although I know quite a few languages that didn't match any I was familiar with. PHP it looked a bit like, however the AtoI was the wrong case for PHP. You see, I tried to do a bit of research for you.
Hence my frustration at being asked to help with so little effort being put into specifying the language. You said it "isn't an Arduino question". It would have been helpful to say "this is a Crestron Simpl+ question".
You go on to say:
The programing is C++ based, the basics are the same.
and also:
this is Crestron Simpl+ programing (Their own version of C) so unlike most where it would normally be == it is only =, so it is in fact an equality test. Using == doesn't compile.