Hmmmm.....<br>I've been using this format for years now with no problems! I did try it with the format string, of course it worked too but added 4 bytes to my code. typically I do something like this:<br><br> csprintf(DATA,"%#4.1f GPM",PULSE_FLOW);<br>
<br><br><br><div class="gmail_quote">On Wed, May 7, 2008 at 2:42 PM, John Baraclough <<a href="mailto:j_baraclough@zetnet.co.uk">j_baraclough@zetnet.co.uk</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In the 'printf()' library function which lies underneath 'csprintf()' a format string is mandatory and therefore you must use:<div class="Ih2E3d"><br>
<br>
csprintf(DATA, "%S", " H2O Flo");<br>
<br></div>
Personally I would also remove the inline string by declaring it in a header file:<br>
<br>
_flash WaterFlowString = " H2O Flo";<br>
<br>
and then using:<br>
<br>
csprintf(DATA, "%S", WaterFlowString);<br>
<br>
in the code file.<br>
<br>
HTH.<br>
<br>
All the best for now,<br>
John<br>
<br>
<br>
Paul Mateer wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="Ih2E3d">
So which is correct (better?) between these two?<br>
<br></div><div><div></div><div class="Wj3C7c">
On Wed, May 7, 2008 at 1:44 PM, John Baraclough <<a href="mailto:j_baraclough@zetnet.co.uk" target="_blank">j_baraclough@zetnet.co.uk</a> <mailto:<a href="mailto:j_baraclough@zetnet.co.uk" target="_blank">j_baraclough@zetnet.co.uk</a>>> wrote:<br>
<br>
John Woods wrote:<br>
<br>
Paul Mateer wrote:<br>
<br>
csprintf(DATA," H2O Flo");<br>
<br>
<br>
*This is the best method. Firstly you need to decide the maximum<br>
length of string that you want to store, then add one byte for the<br>
terminating NULL. Finally you should use:<br>
<br>
<br>
csprintf(DATA, "%S", " H2O Flo");<br>
<br>
but be careful to note that you MUST use upper case 'S%' to<br>
indicate that the string is in Flash only.<br>
<br>
<br>
<br>
*Gerhard at AMS wrote:<br>
<br>
Hi All,<br>
This is rather a stupid question..... (I am even embarresed to<br>
ask this, instead of RTFM!!)<br>
I wish to declare a String Variable : StrName = (String of<br>
Char); Then I wish to somewhere in my prgm state > StrName =<br>
"Hello World";<br>
I know you buffs know the 'how-to' by heart........<br>
Please advise the of the correct ' how-to declare a string<br>
and use of ' for the above?<br>
Your help is appreciated<br>
Thanks,<br>
Gerhard<br>
<br>
<br>
*HTH<br>
<br>
John<br>
<br>
<br>
*<br>
<br>
_______________________________________________<br>
Icc-avr mailing list<br></div></div>
<a href="mailto:Icc-avr@imagecraft.com" target="_blank">Icc-avr@imagecraft.com</a> <mailto:<a href="mailto:Icc-avr@imagecraft.com" target="_blank">Icc-avr@imagecraft.com</a>><div class="Ih2E3d"><br>
<a href="http://dragonsgate.net/mailman/listinfo/icc-avr" target="_blank">http://dragonsgate.net/mailman/listinfo/icc-avr</a><br>
<br>
<br>
<br>
<br>
-- <br>
Paul Mateer, AA9GG<br>
Elan Engineering Corp.<br>
</div><a href="http://www.elanengr.com" target="_blank">www.elanengr.com</a> <<a href="http://www.elanengr.com" target="_blank">http://www.elanengr.com</a>><br>
------------------------------------------------------------------------<div class="Ih2E3d"><br>
<br>
_______________________________________________<br>
Icc-avr mailing list<br>
<a href="mailto:Icc-avr@imagecraft.com" target="_blank">Icc-avr@imagecraft.com</a><br>
<a href="http://dragonsgate.net/mailman/listinfo/icc-avr" target="_blank">http://dragonsgate.net/mailman/listinfo/icc-avr</a><br>
<br>
</div></blockquote><div><div></div><div class="Wj3C7c">
<br>
_______________________________________________<br>
Icc-avr mailing list<br>
<a href="mailto:Icc-avr@imagecraft.com" target="_blank">Icc-avr@imagecraft.com</a><br>
<a href="http://dragonsgate.net/mailman/listinfo/icc-avr" target="_blank">http://dragonsgate.net/mailman/listinfo/icc-avr</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Paul Mateer, AA9GG<br>Elan Engineering Corp.<br><a href="http://www.elanengr.com">www.elanengr.com</a>