Load HTML from the IFS

cgiLoadHtmlIFS

The cgiLoadHtmlIFS procedures loads an HTML document into an internal work buffer and readies it for processing.

The cgiLoadHtmlIFS procedure loads HTML from an IFS file into an internal work buffer and readies it for processing by the cgiSetHtmlVar and cgiWrtSection procedures.

section-count  cgiLoadHtmlIFS(
 szIFSFile           1024A    Const VARYING
 bReplace                N    Const OPTIONS(*NOPASS)
)

See also: cgiLoadHtml, cgiWrtSection, cgiSetHtmlVar cgiInit

Parameters

szIFSFile
[input VChar(1024) const]  The name of the  IFS file that contains the HTML to be loaded. The name may be qualified to a folder/directory as illustrated below:
 
 *...v....1....v....2....v....3....v....4....v....5....v....6....
'/www/docs/orderform.html'
bReplace  [ optional ] DFT(*OFF)
[input Indy const]  Replace the internal HTML work buffer before loading the new HTML file. If *OFF is specified for this parameter or the parameter is not specified, the HTML file being loaded is added to the end of the existing work buffer. This allows you to load multiple HTML files into a single work buffer and treat them as one entity. Note that a call to the cgiInit() always clears the internal work buffer so the setting of this parameter has no influence during the first call to cgiLoadHtmlIFS.

Return Value

If the function succeeds, the return value is the number of CGILIB Sections that were loaded. If the function fails, 0 is returned and a message is written to the joblog.

Remarks

Call cgiLoadHtmlIFS to load HTML from the IFS only. Do not use it to load HTML stored in source file members. For source members, use the cgiLoadHtml procedure.

Example

      /INCLUDE XTOOLS/QCPYSRC,CGI
 
.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
     D CONTACT         S             20A
     D CMPNAME         S             30A  
     D PHONE           S             11P 0
 
.....C..n01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++++
     C                   callp     cgiInit(0)
     C                   eval      CONTACT = cgiGetVar('CONTACT')
     C                   eval      CMPNAME = cgiGetVar('COMPANY')
     C                   eval      PHONE   = cgiGetVarI('PHONE')
     C                   if        cgiLoadHtmlIFS('/cozzi/confirm.html') <= 0
     C                   callp     wrtjoblog('Could not load HTML file.')   
     C                   endif