<html> <head> <title>This is DEMO 3</title> </HEAD> <body> <H2> DEMO 3</h2> <p> This demo shows how to use the subroutine 5000 from a Load HTML created program to add run time data <form method="post" action="FORMINPUT"> <B>Enter String: </b><input TYPE="Text" NAME="STRING" SIZE=40 VALUE=""><BR><br> <B>Check or Uncheck this checkbox</b><br> <B>Check Box: </b><input type="Checkbox" value="CHECKED" name="CHECKBOX" ><BR> <BR> <input type="submit" name="CANCEL" value="Cancel"> <input type="submit" name="DOIT" value=" Do It "> <input type="submit" name="NEXT" value=" Next "> </form> </body> </html>The Load Html Utility creates the program D_DEMO3 from demo3.html.
10 REM "DEMO3"
100 REM 100,5
105 LET I=1
110 PRINT 'gwin'("WEB"),
115 DIM P!
120 LET S$="Run Time Data #"+STR(I)+" BOX is "
125 IF MOD(I,2)=0 THEN LET C$="",S$=S$+"UNCHECKED" ELSE LET C$="CHECKED",S$=S$+"CHECKED"
130 CALL "D_DEMO3",P![ALL],S$,C$
135 REM "Don't accept Enter as end of input"
140 IF P!["CANCEL"]="" AND P!["DOIT"]="" AND P!["NEXT"]="" THEN LET P!["FLAG"]="NoDisplay";GOTO 0130
145 PRINT "The Program D_DEMO3 returned because:"
150 IF P!["CANCEL"]<>"" THEN PRINT "Cancel button was hit"
155 IF P!["DOIT"]<>"" THEN PRINT "Do It button was hit"
160 IF P!["NEXT"]<>"" THEN PRINT "Next button was hit"
165 PRINT ""
170 PRINT "The textbox contains:"+$22$+P!["STRING"]+$22$
175 PRINT "The Check Box is ",
180 IF P!["CHECKBOX"]<>"" THEN PRINT "Checked" ELSE PRINT "Unchecked"
185 IF P!["NEXT"]<>"" THEN LET I=I+1;GOTO 0115
190 PRINT 'gwin'("CONSOLE"),
DEMO3 is identical to DEMO2 except it calls D_DEMO3.
Demo3 passes into D_DEMO3 S$ and C$ to be used by subroutine 5000 to add run time data to the page.
To make the page a little more interesting, if the Next button is pressed, the page is
redisplayed with slightly modified run time data.130 ENTER P![ALL],S$,C$ 5000 REM 5000,5 5005 CALL GET_ID_HTML,"STRING",A$ 5010 LET A$=A$(1,LEN(A$)-1)+" VALUE="+$22$+S$+$22$+">" 5015 CALL SET_ID_HTML,"STRING",A$ 5020 IF C$="" THEN GOTO 5040 5025 CALL GET_ID_HTML,"CHECKBOX",A$ 5030 LET A$=A$(1,LEN(A$)-1)+" CHECKED>" 5035 CALL SET_ID_HTML,"CHECKBOX",A$ 5040 RETURNThe ENTER adds the run time data variables. Subroutine 5000 modifies the HTML page that is currently being displayed.
| P! | Value |
|---|---|
| ["url"]= | DIR(-1)+"HTML\FORMINPUT" - "FORMINPUT" is the ACTION= from the FORM tag |
| ["STRING"]= | the contents of the text box |
| ["CHECKBOX"]= | "" if not checked or "CHECKED" if checked - "CHECKED" is the VALUE= from the the INPUT tag |
| ["DOIT"]= | "" if the Do It button was not pressed or " Do It " if it was - " Do It " is the VALUE= from the the INPUT tag |
| ["CANCEL"]= | "" if the Cancel button was not pressed or " Cancel " if it was - " Cancel " is the VALUE= from the the INPUT tag |
| ["NEXT"]= | "" if the Next button was not pressed or " Next " if it was - " Next " is the VALUE= from the the INPUT tag |