Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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. my website and the WebBatch site are both done with weber files.

It's great for creating huge sites from templates, etc. If I get around to it, I might write a couple ODBC or SQL "verbs" for weber files, which would make it easy to publish huge websites generated from databases.

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

http://www.bulldogbeach.com/weberfiles/.


Article ID:   W12476
Filename:   How to Change and Embed Something in an HTML doc.txt