Newbie - How do I writie a variable to web with writstring

Discussion to talk about software related topics only.
Post Reply
greg_edwards
Posts: 2
Joined: Sat Jan 28, 2012 5:03 pm

Newbie - How do I writie a variable to web with writstring

Post by greg_edwards »

I'm new to the world of ethernet connectivity and working on my
first project leveraging the SB70LCApp example. I'm trying to write
an integer variable to the webpage and haven't been able to get writestring
to work properly. I've been successful using writestring to write static information to the webpage - [writestring( sock, " The Grounding Switch is Open <BR> <BR> \n" );] .

Is writestring the proper tool or should I be using a different method?

Thanks,

Greg
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: Newbie - How do I writie a variable to web with writstri

Post by seulater »

take a look in your nerburner example folder at this example and see if that is what you are looking to do.

C:\nburn\examples\Web\HtmlVariables
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Newbie - How do I writie a variable to web with writstri

Post by rnixon »

writestring only writes text, and you are trying to write an integer, correct? Try using siprintf() to crate a string out of the integer, then use writestring(). Note that you need to use sprintf() if doing floats.
greg_edwards
Posts: 2
Joined: Sat Jan 28, 2012 5:03 pm

Re: Newbie - How do I writie a variable to web with writstri

Post by greg_edwards »

Thanks for your help. I used siprintf() and then write() and it correctly wrote the integer variable to the web page. Mucho Gracias!

Greg
Post Reply