Skip to main content development
   toolset
 
  Easy400   |       iSeries home
Public-Source
 
Introduction
Tutorial
Examples
FAQ
Index
Download
 
 

 
2.2 - Working with an external HTML


The answer from a CGI program to the client browser is an HTML string.

Without using our service program procedures, a CGI would have to build up piece by piece such an HTML string and write it out using the Write to Stdout (QtmhWrStout) API.

Preparing such a string in a program, while not easy, suffers of unflexibility. Any time you want to change something in the output HTML (texts, fonts, alignments, href, gifs, etc.), you would have to update and re-create your program.

You would hate this, having experienced the advantage of separating the process from the presentation, as it is done with display files.

CGICBLDEV2 service program procedures allow something similar to DDS, though much simpler and more powerful.

  • You write your output HTML on an external support, a source file member or a stream file
  • You divide the external HTML in "sections" (conceptually similar to DDS record formats)
  • Each section is then a mixture of HTML text and "output variables"
Your CGI program will then call our procedures to
  • load the external HTML
  • assign values to the "output variables"
  • write out the appropriate HTML "sections"
  • send the HTML string (the HTML output buffer)
Please go across the following:
  2.2.1 -  Creating an external HTML
  2.2.2 -  Loading the external HTML
  2.2.3 -  Substituting output variables
  2.2.4 -  Writing sections and sending the output buffer



    Contact