subroutine programming.bas9b(status)
***********************************************************************
* Programming example 9b, process a non-persistent request
* status = "" is success, other = failure
***********************************************************************
*
* [00] 02Nov00 jr Initial Creation
include wbp w3Include
*~<~FONT COLOR=RED~>~
status = ""
*~<~/FONT~>~
* 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("","")
*~<~FONT COLOR=RED~>~
status = -1
*~<~/FONT~>~
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
return