subroutine programming.bas9c
*****************************
* Example application driver
*****************************
include wbp w3include
NextPage = ""
FormName = ""
call w3getval(NextPage,"NextPage") ;* Indicates which page the
* user next wants to see
call w3GetVal(FormName, "FormName") ;* Contains the name of the
* form being submitted
CRT "NextPage: ":NextPage
CRT "FormName: ":FormName
* Simple process:
*
* If the form is processed ok show the next form they requested.
* If the form has errors, handle the error (which usually means
* redisplaying the form for correction) and do not shown the next form
* they requested.
status = "" ;* Processing completion status
begin case ;* Process the incoming form
case FormName = "programming.bas9a"
call programming.bas9b(status) ;* status ok = "", otherwise name
* of form to next display
if status # "" then NextPage = skip ;* the application is responsible
* for displaying any error pages
case FormName = "SecondForm" ;* in this example there is no
* call SomeOtherProgram second form to submit. However, if
* there were, this is where
* processing of it would start
case 1
* do nothing if no formname submitted
end case
begin case ;* Generate outgoing form
case NextPage = "page1"
call programming.bas9a
case NextPage = "page2"
call programming.bas9d ;* Show the last set of responses
case NextPage = "skip" ;* Allows the processing program
* to generate the next form and
* skip the form generated here
case 1
call programming.bas9a ;* default form is the first form
end case
return