-->
Page 3 of 4

Re: How variable values are embedded within the html text?

PostPosted: Fri Feb 22, 2019 6:48 am
by FRANCISCOGIMENO1000
Hello, it's a size problem.
For it to work, I had to split the string and send it.
otherwise, it did not work

Code: Select all
copy and principal string split:------
webconcopia1 = webcon1;
webconcopia2 = webcon2;
webconcopia3 = webcon3;

replace values--------------------------------------------------------------------------
  webconcopia1.replace("VAR1", " checked=\"checked\" ");
  webconcopia1.replace("VAR2", "");
  webconcopia1.replace("VAR3", "");
  webconcopia1.replace("VAR4", " checked=\"checked\" ");
  webconcopia1.replace("VAR5", "");

  webconcopia2.replace("VAR6", "value=4");
  webconcopia2.replace("VAR7", "value=TEXT");
  webconcopia2.replace("VAR8", "value=1234");

  webconcopia3.replace("VAR9", "value=1234");
  webconcopia3.replace("VAR10", "value=1234");
  webconcopia3.replace("VAR11", "value=100");

----------------------------------
SEND ZONE
webServer.sendContent(webconcopia1);
webServer.sendContent(webconcopia2);
webServer.sendContent(webconcopia3);
webServer.send(200, "text/html", webcon4);  <-----END HTLM BODY


I do not know why you can not with such a simple page 11K (9.919 carateres with spaces included)

Re: How variable values are embedded within the html text?

PostPosted: Fri Feb 22, 2019 6:54 am
by rudy
Strings use is very inefficient. I'm sure that 11K is duplicated, or worse.

This is one of the reasons I try to send the code without using Strings.

Re: How variable values are embedded within the html text?

PostPosted: Fri Feb 22, 2019 6:59 am
by FRANCISCOGIMENO1000
So what do you suggest?
How can I do better, or how do you do it?

Re: How variable values are embedded within the html text?

PostPosted: Fri Feb 22, 2019 7:56 am
by Pablo2048
If you want to go with this way, try to use this https://github.com/winder/ESPTemplateProcessor ...