Add a database
Modify the PROJ1 program to display some information from
a database file. In the samples directory of the Superbase
Internet Server directory are two files; TOPICS and ITEMS.
This modification of the program will:
1. display a heading with a horizontal rule
2. open up the TOPICS file if it isn't already open
3. select the first record
4. step through the file one record at a time
5. and display the results in bold on the WEB page.
SUB PROJ1(RetValue$)
CALL HTML("<HTML>")
CALL HTML("<HEAD><TITLE>")
CALL HTML("Project 1 code generated page")
CALL HTML("</TITLE></HEAD>")
CALL HTML("<BODY>")
CALL HTML("<H1>These topics are available:</H1><HR>")
IF NOT OPEN ("TOPICS") THEN OPEN FILE DIRECTORY
+ "\SAMPLES\TOPICS.SBF"
SELECT FIRST FILE "TOPICS"
WHILE NOT EOF ("TOPICS")
CALL HTML("<B>" + TOPIC.TOPICS + "</B>")
SELECT NEXT FILE "TOPICS"
CALL HTML("<P>")
WEND
CALL HTML("</BODY></HTML>")
END SUB
|