<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Protože to je String a ne string :-)</p>
<p>String:</p>
<p><a class="moz-txt-link-freetext" href="https://www.arduino.cc/en/Reference/StringObject">https://www.arduino.cc/en/Reference/StringObject</a></p>
<p>string = char array</p>
<p><a class="moz-txt-link-freetext" href="https://www.arduino.cc/en/Reference/String">https://www.arduino.cc/en/Reference/String</a></p>
<p>To jsou 2 diametrálně odlišné proměnné a jinak se s nimi pracuje.</p>
<p>Petr<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">Dne 31. 10. 17 v 12:33 hwnews
konference napsal(a):<br>
</div>
<blockquote type="cite"
cite="mid:CAFMbtH_EC+aOkC_R-BQ5T=Dwp3aSJaDVX6iHS+i95d3X3M2bNA@mail.gmail.com">
<div dir="ltr">Hmmm, tak proc funguje tohle:
<div><br>
</div>
<div>
<div>String message = "File Not Found\n\n";</div>
<div> message += "URI: ";</div>
<div> message += server.uri();</div>
<div> message += "\nMethod: ";</div>
<div> message += (server.method() == HTTP_GET)?"GET":"POST";</div>
<div> message += "\nArguments: ";</div>
<div> message += server.args();</div>
<div> message += "\n";</div>
<div> for (uint8_t i=0; i<server.args(); i++){</div>
<div> message += " " + server.argName(i) + ": " +
server.arg(i)+ "\n";<br>
</div>
<div> }<br>
</div>
<div> server.send(404, "text/plain", message);</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-10-31 12:20 GMT+01:00 Jaromir
Sukuba <span dir="ltr"><<a
href="mailto:jarin.hw@gmail.com" target="_blank"
moz-do-not-send="true">jarin.hw@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">" message += " " + rv_text+ "\n";"<br>
</span>takto sa v C-cku stringy nespajaju. Vlastne, v C-cku
neexistuju<br>
stringy, ale polia char-ov ukoncene nulami (a vlastne ani
tie polia<br>
neexistuju, len kus pamate na ktory ukazuje smernik). Tie sa
daju<br>
spajat trebars cez funckiu strcat, alebo mozno povedzme aj
sprintf-om<br>
(ma vacsie moznosti, ale tazkopadnejsia metoda).<br>
<div>
<div class="h5"><br>
2017-10-31 12:11 GMT+01:00 hwnews konference <<a
href="mailto:hwnews@cncnet.info"
moz-do-not-send="true">hwnews@cncnet.info</a>>:<br>
> Zdravim,<br>
><br>
> delam si ten palubni budik na lod s e-ink
displejem a ESP32. Ohybam nejake<br>
> knihovny, ktere jsou v examplech...na displej uz
kreslim, web mi take jede,<br>
> ale zasekl jsem se na pro me nepochopitelne
definici procedury:<br>
><br>
> void DrawStringAt(int x, int y, const char* text,
sFONT* font, int colored);<br>
><br>
> ja jsem tu deklaraci puvodne nezkoumal, protoze
primo vlozeny string jako<br>
> parametr fungoval<br>
><br>
> Kdyz jsem to ale chtel pouzit takto tak jsem si
nabehnul:<br>
><br>
> for (uint8_t i=0; i<server.args(); i++){<br>
> rv_text = server.argName(i) + ": " +
server.arg(i);<br>
> message += " " + rv_text+ "\n";<br>
> paint.DrawStringAt(0, 0, rv_text, &Font8,
UNCOLORED);<br>
> epd.SetPartialWindow(paint.<wbr>GetImage(), 0,
20+(i*12), paint.GetWidth(),<br>
> paint.GetHeight());<br>
> }<br>
><br>
><br>
> void DrawStringAt(int x, int y, const char* text,
sFONT* font, int colored);<br>
>
^<br>
> epdpaint.h:56:10: note: no known conversion for
argument 3 from 'String'<br>
> to 'const char*'<br>
><br>
> cela ta procedura je napsana takto:<br>
><br>
> void Paint::DrawStringAt(int x, int y, const char*
text, sFONT* font, int<br>
> colored) {<br>
> const char* p_text = text;<br>
> unsigned int counter = 0;<br>
> int refcolumn = x;<br>
><br>
> /* Send the string character by character on
EPD */<br>
> while (*p_text != 0) {<br>
> /* Display one character on EPD */<br>
> DrawCharAt(refcolumn, y, *p_text, font,
colored);<br>
> /* Decrement the column position by 16 */<br>
> refcolumn += font->Width;<br>
> /* Point on the next character */<br>
> p_text++;<br>
> counter++;<br>
> }<br>
> }<br>
><br>
> Jak by se to melo upravit abyto bylo koser?<br>
><br>
> RV<br>
><br>
</div>
</div>
> ______________________________<wbr>_________________<br>
> HW-list mailing list - sponsored by <a
href="http://www.HW.cz" rel="noreferrer" target="_blank"
moz-do-not-send="true">www.HW.cz</a><br>
> <a href="mailto:Hw-list@list.hw.cz"
moz-do-not-send="true">Hw-list@list.hw.cz</a><br>
> <a href="http://list.hw.cz/mailman/listinfo/hw-list"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://list.hw.cz/mailman/<wbr>listinfo/hw-list</a><br>
><br>
______________________________<wbr>_________________<br>
HW-list mailing list - sponsored by <a
href="http://www.HW.cz" rel="noreferrer" target="_blank"
moz-do-not-send="true">www.HW.cz</a><br>
<a href="mailto:Hw-list@list.hw.cz" moz-do-not-send="true">Hw-list@list.hw.cz</a><br>
<a href="http://list.hw.cz/mailman/listinfo/hw-list"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://list.hw.cz/mailman/<wbr>listinfo/hw-list</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
HW-list mailing list - sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
</blockquote>
<br>
</body>
</html>