programming.bas8b

subroutine programming.bas8b

***********************************************************************

* Programming example 8b, process a non-persistent request

***********************************************************************

*

* [00] 02Nov00 jr Initial Creation

include wbp w3Include

*~<~FONT COLOR=RED~>~

* Note that most of this is the same code from the previous step

* just split into two parts.                              

* New program, open the files

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

*~<~/FONT~>~

* Get the value set by the user

* ---------------------------------------

results = ""

call w3GetVal(results, "like")

                                         

* Add the response to every record in the database

* ------------------------------------------------

select f.data

done = 0

loop

    readnext id else done = 1

until done do

    writev results on f.data, id, 3

repeat

close f.data

                     

*~<~FONT COLOR=RED~>~

* Set the closing page so the Browser will return to the Web page

* where it started. Alternatively, the prior program could save

* the closing page in a named common variable which would be

* referenced here.

w3ClosingPage = "/w3library/programming.html"

*~<~/FONT~>~

return