Showing variables in webserver

For general Flowcode discussion that does not belong in the other sections.
Post Reply
RGV250
Posts: 264
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Showing variables in webserver

Post by RGV250 »

Hi,
I am trying to find out about variables in a webserver, this does not seem to be that well documented. I found a post on the old forum from around 2004. I found 2 on this forum but both require App developer so I cannot open them as I do not have it.
I looked on the WiKi but drew a blank. Also there appears to be quite a limitation with 4 variables per page?
Could someone point me to a good example and to where the information is with all the limitations and if there are ways around this or has it improved with the newer versions of FC.
I plan to use either ESP32 or possibly Raspberry Pi but that would require a licence so not good for a demo.

Regards,
Bob

BenR
Matrix Staff
Posts: 1726
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 438 times
Been thanked: 602 times

Re: Showing variables in webserver

Post by BenR »

Hello Bob,

The webserver Generic component allows for up to 30 individual outgoing substitutions to be made to show things like variables.

Simply set how many substitutions you would like and their length via the component properties.

To reference the substitution on your html page simply use %0 to %29 to reference the substitution. If you need to display a % character then use %% in your HTML code.

Set the value of the substituion using the SetOutValue macro. For numeric values you can convert them to string by using the ToString$() or FloatToString$() functions.

This video shows the basics of creating a ESP32 based webserver.
https://www.youtube.com/watch?v=DaViZAhSxuQ

Post Reply