$Web Flush: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(Automatically generated page update) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Web_Flush}} | {{DISPLAYTITLE:$Web_Flush}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Clear contents of Web response buffer</span> | ||
$Web_Flush clears the contents of the client buffer. | <var>$Web_Flush</var> 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. | <var>$Web_Flush</var> takes no arguments and returns a numeric status code. It is a [[Calling_Sirius_Mods_$functions|callable]] $function. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%rc</span> <span class="literal">= $Web_Flush</span> | ||
< | </p> | ||
=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | |||
<tr><th>%rc</th> | |||
<td>A numeric status code: | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>Code</th> | <tr><th>Code</th> | ||
Line 18: | Line 21: | ||
<tr><th>-1</th> | <tr><th>-1</th> | ||
<td>Not a web thread</td></tr> | <td>Not a web thread</td></tr> | ||
</table> | |||
</td></tr> | |||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <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. | <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. <var>$Web_Flush</var> 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. | <li>Use <var>$Web_Flush</var> when the application detects an error and needs to change the sent content. | ||
</ul> | </ul> | ||
Line 30: | Line 35: | ||
<p class="code">ON FIND CONFLICT | <p class="code">ON FIND CONFLICT | ||
% | %x = $Web_Flush | ||
% | %x = $Web_Type('text/HTML') | ||
% | %x = $Web_ProcSend( 'WEBFILE', 'OFC.HTML' ) | ||
STOP | STOP | ||
Line 38: | Line 43: | ||
</p> | </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 | In the above example, <var>$Web_Flush</var> is used in an <var>ON</var> unit to clear any information in the client buffer before the content type is set and the static HTML in procedure <code>OFC.HTML</code> is sent to the client. </p> | ||
==See also== | ==See also== |
Latest revision as of 15:50, 9 April 2013
Clear contents of Web response buffer
$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
%rc = $Web_Flush
Syntax terms
%rc | A numeric status code:
|
---|
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.