WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How to

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Embedded Output

Keywords:     WebOutFile    Weber files

Question:

I want to insert a date string into my HTML. I can do this quite readily with WIL but I don't see how I can include this in an HTML document. It seems that the whole document has to be output from WebBatch which is a bit tedious to do.

Is there any easy way to do this? I've not had any luck with the embed command and I haven't yet delved into server-side includes.

Answer:

There are several techniques. I'll outline them.
  1. The hard way. WebOut the entire html file.

  2. Figure out the constant portion of the files. Have several files, one for each section. Basically to put a change in the middle you WebOutFile-WebOut-WebOutFile.

  3. Load entire file into binary buffer, Load into variable via BinaryPeekStr. Do StrReplace on the string. Works for files mabe upto 6-12K in size.

  4. Weber files is an extension of #3, with all the bells and whistles you can imagine. You could also fight with that.

Thread (continued):

Mmmmh....

I guessed that there wouldn't be a ready answer (a limitation of HTML and not WebBatch I should point out). So, over the weekend, I gave it some some thought and have split the page into frames. Into one frame I load the output from my WebBatch script by triggering it via a META HTTP-EQUIV... tag. I have now extended the simple date format to include the time and, again by using META tags, I get the browser to auto-reload the date/time frame every 30 seconds so keeping the time correct. Neat eh?

Response:

To elaborate a little, weber files are basically HTML files with WebBatch subroutines inserted within curly braces. It's an extension to WebBatch written in WebBatch. The syntax is a little opaque, but once you figure it out you can pretty much do anything you want. The WebBatch site is done with weber files.

It's great for creating huge sites from templates, etc.

More info & complete source code (hack away!) is at:

http://www.webbatch.com/webcgi/webbatch.exe?budu/weber.web+howdone.weber+main+null


Article ID:   W12476
Filename:   How to Change and Embed Something in an HTML doc.txt
File Created: 2011:06:07:08:12:34
Last Updated: 2011:06:07:08:12:34