Write CGI Section to Buffer

cgiFlushBuffer

The cgiFlushBuffer procedure sends all merged HTML or XML or other text that is currently in the CGI output buffer to the standard output device. 

The cgiFlushBuffer procedure writes the text in the CGI buffer to standard output via a call to QtmhWrStout. It send this in one or two calls depending on the size of the output buffer. Fewer calls to QtmhWrStout can improve output performance.

NOTE: The recommended method for sending the output buffer to the standard output device is by calling the cgiWrtSection('*FLUSH') procedure.

nBytesWritten  cgiFlushBuffer(
 szOutputBuffer        21A    Const OPTIONS(*NOPASS:*OMIT)
 bCgiHeader             1N    Const OPTIONS(*NOPASS:*OMIT)
)

See also: cgiWrtSection

Parameters

szOutputBuffer  [ optional ]
[input Char(21) const]  The name of a user space that is being used to buffer the CGI output. Normally you do not specify a value for this parameter. If bCgiheader is specified, specify *OMIT for this parameter.

 

bCgiHeader  [ optional ] DFT(*ON)
[input Indy(1) const]  By default, cgiFlushBuffer checks the output buffer for a valid "Content-type" header. If there is not a Content-Type header, one is automatically generated as "Content-Type: text/html\n\n". Specify *OFF if you do not want an automatic CGI header to be generated if none is detected.

 

 

Return Value

The return value is the number of bytes written to the standard output device.

Example

The following sends the CGI output buffer to the standard output device and does not check for a valid CGI header.

     /INCLUDE XTOOLS/QCPYSRC,cgi
 
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++++++++

     C                   Eval      cgiFlushBuffer(*OMIT : *OFF )