$Web Flush: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Clear contents of Web response buffer<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Clear contents of Web response buffer<section end="desc" /></span>


$Web_Flush clears the contents of the client buffer.


$Web_Flush takes no arguments and returns a numeric status code. It is a [[Calling_Sirius_Mods_$functions|callable]] $function.


$Web_Flush clears the contents of the client buffer.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Web_Flush
<p class="syntax"><section begin="syntax" />%rc = $Web_Flush
<section end="syntax" /></p>
<section end="syntax" /></p>


 
===Status codes===
$Web_Flush takes no arguments and returns a numeric status code. It is a callable $function (see [[Calling_Sirius_Mods_$functions|"Calling Sirius Mods $functions"]]).
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>Code</th>
<tr><th>Code</th>
Line 18: Line 18:
<tr><th>-1</th>
<tr><th>-1</th>
<td>Not a web thread</td></tr>
<td>Not a web thread</td></tr>
</table>
</table>
<p class="caption">$WEB_FLUSH return codes</p>


==Usage notes==
<ul>
<li>Everything sent to a client is buffered and sent at the completion of the request. This allows lines to be put to the client buffer (CCATEMP) from many points in the application, and the send to be performed once. $Web_Flush clears the client buffer and allows the application to begin building the buffer over again from scratch.


Everything sent to a client is buffered and sent at the completion of the request. This allows lines to be put to the client buffer (CCATEMP) from many points in the application, and the send to be performed once. $Web_Flush clears the client buffer and allows the application to begin building the buffer over again from scratch.  
<li>Use $Web_Flush when the application detects an error and needs to change the sent content.
</ul>


Use $Web_Flush when the application detects an error and needs to change the sent content.
==Examples==
<p class="code"> ON FIND CONFLICT
<p class="code">ON FIND CONFLICT
   
   
%X = $Web_Flush
%X = $Web_Flush
%X = $Web_Type('text/HTML')
%X = $Web_Type('text/HTML')
%X = $Web_ProcSend( 'WEBFILE', 'OFC.HTML' )
%X = $Web_ProcSend( 'WEBFILE', 'OFC.HTML' )
STOP
STOP
   
   
END ON
END ON
</p>
</p>
<p>
In the above example, $Web_Flush is used in an ON unit to clear any information in the client buffer before the content type is set and the static HTML in procedure 'OFC.HTML' is sent to the client. </p>


 
==See also==
In the above example, $Web_Flush is used in an ON unit to clear any information in the client buffer before the content type is set and the static HTML in procedure 'OFC.HTML' is sent to the client.
<ul>
 
<li><var>[[$Web_Off]]</var> and <var>[[$Web_On]]</var>
See also [[$Web_Off]] and [[$Web_On]].
</ul>


[[Category:Janus Web Server $functions|$Web_Flush]]
[[Category:Janus Web Server $functions|$Web_Flush]]

Revision as of 23:12, 12 October 2012

<section begin="desc" />Clear contents of Web response buffer<section end="desc" />

$Web_Flush clears the contents of the client buffer.

$Web_Flush takes no arguments and returns a numeric status code. It is a callable $function.

Syntax

<section begin="syntax" />%rc = $Web_Flush <section end="syntax" />

Status codes

Code Meaning
0 Completed successfully
-1 Not a web thread

Usage notes

  • Everything sent to a client is buffered and sent at the completion of the request. This allows lines to be put to the client buffer (CCATEMP) from many points in the application, and the send to be performed once. $Web_Flush clears the client buffer and allows the application to begin building the buffer over again from scratch.
  • Use $Web_Flush when the application detects an error and needs to change the sent content.

Examples

ON FIND CONFLICT %X = $Web_Flush %X = $Web_Type('text/HTML') %X = $Web_ProcSend( 'WEBFILE', 'OFC.HTML' ) STOP END ON

In the above example, $Web_Flush is used in an ON unit to clear any information in the client buffer before the content type is set and the static HTML in procedure 'OFC.HTML' is sent to the client.

See also