Associate URL links
The last step is to the individual WEB pages. All you need
to do is change one line of code in the example above to include
the information from the URL.ITEMS field and change the output
from straight text to a link using the <A HREF= link>
element.
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"
IF NOT OPEN ("ITEMS") THEN OPEN FILE DIRECTORY
+ "\SAMPLES\ITEMS.SBF"
FILE "ITEMS"
INDEX TOPIC_ITEM
FILE "TOPICS"
INDEX TOPIC
SELECT FIRST FILE "TOPICS"
WHILE NOT EOF ("TOPICS")
CALL HTML("<B>" + TOPIC.TOPICS + "</B>")
FILE "ITEMS"
SELECT FIRST FILE "ITEMS"
SELECT KEY TOPIC.TOPICS
WHILE TOPIC.ITEMS = TOPIC.TOPICS AND NOT EOF ("ITEMS")
CALL HTML("<BR>")
CALL HTML("<A HREF=~" + URL.ITEMS + "~>"
+ ITEM.ITEMS + "</A>")
SELECT NEXT FILE "ITEMS"
WEND
SELECT NEXT FILE "TOPICS"
CALL HTML("<P>")
WEND
CALL HTML("</BODY></HTML>")
END SUB
Your final page should look like figure 9 except the listed
items should now be a different color and if you click on
them, you will jump to the location of the link (If you are
not connected to the Internet, you will get an error message
if you click on one of these links).
|