subroutine programming.bas3
***********************************************************************
* Programming example 3, add a cookie
***********************************************************************
*
* [00] 25Nov97 jr Initial Creation
* [01] 02Nov00 jr Update programming style
include wbp w3Include
* prepare substitution strings for the header
substitutions = ""
substitutions<1,1> = "$$TITLE$$"
substitutions<1,2> = "Simple, but boring"
open "programming" to f.data else
call w3HtmlInit("", "")
call w3HtmlHeader("","")
call w3Printn("<HTML><BODY><H3>Application error</H3>")
call w3Printn("<P>Cannot open the file 'programming'")
call w3HtmlFooter("","")
return
end
header = "**HEADING**":@VM:"Three Employees"
* set up the HTML page
* ~<~FONT COLOR=RED~>~
* Add a cookie to the page
* Cookie name is "programming"
* Cookie value is "set by us"
call w3HtmlCookie("programming=set by us","", "", "", "", "")
* ~<~/FONT~>~
call w3HTMLInit("programming","") ;* use programming.headfoot.htm
call w3HTMLHeader("",substitutions)
call w3HTMLInsertSection("programming1", header, "head")
select f.data
subs = ""
done = 0
loop
readnext id else done = 1
until done do
readv addr from f.data, id, 1 then
subs<1> = "col1":@VM:id
subs<2> = "col2":@vm:addr
call w3HtmlInsertSection("programming1", subs, "detail")
end
repeat
call w3htmlInsertSection("programming1", "", "end")
call w3HTMLFooter("","")
close f.data
return