Strings are needed ALL THE TIME! I wish PBP would face the music and implement them! Every other compiler I see has them, why not PBP? (And No, I don't want to switch because I've got years and $ invested in this one.)
Like I asked before, what type of project would you do that needs this?
I am not trying to be difficult, I just have not had the need beyond what is already there.
It might be fun/interesting to write a library/include to handle some of this stuff. If an example of it's usage was given I might give it a go...
Dave
Always wear safety glasses while programming.
Well, my last embedded project was a remote control for some specialty plasma monitors. The language used in the remotes uses exclusively strings for control. As I said before in another post, strings are a fact of life, get over it. Just as numbers, and variables, strings are used in everyday life and becoming more and more necessary for any kind of efficient programming. Rediculious little FOR...NEXT loops to parse out a string character by character are S T U P I D and a waste of time. IMO. Words are a fact of life. Adjust.
Now that the "Warm Fuzzies" are flowing ...
With PBP 2.60 ...
The ARRAYREAD and ARRAYWRITE commands are quite useful for dealing with Strings.
<br>
DT
Sorry, I just feel so strongly about this and struggle every time a new project comes up because of these features lacking in PBP. I guess I'm a ranter! Sorry.
Here's an example and something that I'm working on now. I am debugging a program that will read 3 axes of an accelerometer via A/D conversion. The sampled value is a number and I'd like to convert it to an array of text that I can send to the USB port. The pic is enumerating as a USB serial port so I can read it via a terminal program.
Anybody know an efficient way to convert a 10-bit value to a number string?
Sure ... If you have PBP 2.60?Anybody know an efficient way to convert a 10-bit value to a number string?Or for 3-axis ...Code:ARRAYWRITE MyArray,[DEC4 MyValue]____________Code:ARRAYWRITE MyArray,[DEC4 Xaxis, DEC4 Yaxis, DEC4 Zaxis]
DT
![]()
OK, cool.
Looks like its a good time to pay my $25 and upgrade from 2.46. BTW, I used your interrupt based USB servicing include file. Works great. Thanks for sharing that.
Only 2 years later and still no string commands. Left(2), Right(3), etc. I'm almost too old to code anymore... so much for waiting around.
I do understand what you mean, I can't argue against however...
What's a string? A couple of consecutive character
What's an Array? A couple of consecutive Byte
A single Character = Byte
Array are supported, therefore Strings are.
ArrayWrite/ArrayRead, a spoon of creativity and you're all set. Sprinkle a macro in the equation (for ease of use) and VOILA!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks