HTML Variable Question

Discussion to talk about software related topics only.
Post Reply
ccoleman
Posts: 9
Joined: Wed Nov 05, 2008 8:55 am

HTML Variable Question

Post by ccoleman »

So trying to make a website that will post variables within my application files to the site.

Problem is the documentation isn't all that helpfull, and the example code doesn't even work. I tried compiling the HtmlVariables example and it's having the same problem my project is, a whole lot of
int DoHtmlVariable(int, WORD)':
htmldata.cpp:85: error: 'TimeTick' was not declared in this scope,
or whatever the value is in the <!--VARIABLE call

So where do these variables have to be declared in order for one to be able to pull their values?

I have my main.cpp, and a web.cpp file, I can call the funciton in my web.cpp using the <!--FUNCTIONCALL just fine, or at least as far as I can tell, so what do I have to do to get variables?
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: HTML Variable Question

Post by Forrest »

Hello,

Make sure that you have a file htmlvar.h in your project base directory. You should see this file in C:\nburn\examples\Web\HtmlVariables in the example app you are referencing. Do you have this file?
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
ccoleman
Posts: 9
Joined: Wed Nov 05, 2008 8:55 am

Re: HTML Variable Question

Post by ccoleman »

Yes I have an htmlvar.h file, though its not very clear whats supposed to be in here.

What I gathered is that you can do the whole <!--VARIABLE call on known variables, but anything that you make in the program it's best to use the FUNCTIONCALL or the VARIABLE call as a function. This is the only way I could get it to compile.

Then I ran into troubles trying to get the DEBUG to work as it was saying a problem about how there was no htmlvar.h filel, strange as the release builds would compile and run fine.

So looked at the path info for the project again, respecified it again, and it seemed to work better, except now in Debug it's constantly saying it can'd find the source, has a button to click to specify, but that doesn't really do much.
drdoug
Posts: 4
Joined: Sun Nov 23, 2008 12:50 pm

Re: HTML Variable Question

Post by drdoug »

I'm a netburner newbie and am having the same problem with the variables, .h files and the dynamic examples (although most other examples I have tried work fine).

I would appreciate anyone's comments or direction at this point.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: HTML Variable Question

Post by rnixon »

The example worked fine for me. Did you see the part in main.cpp comments (at the top) that say you need to add the path of htmlvars.h to the project? Once I did that it worked fine.
ccoleman
Posts: 9
Joined: Wed Nov 05, 2008 8:55 am

Re: HTML Variable Question

Post by ccoleman »

I ended up just using either FUNCTIONCALL to get a variable, or the variable call to use it as a function, both of which work fine. But using the VARIABLE to just return a variable does not seem to work... not sure why, but meh don't see the need if you can just do the same thing with FUNCTIONCALL (well I guess you are writing getters when the VARIABLE call just returns the variable, ahh well)
Post Reply