$Web Output Content: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 43: | Line 43: | ||
<p>'''Note:''' ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the <var>CR</var>, <var>LF</var>, or <var>CRLF</var> setting of <var>[[JANUS DEFINE]]</var>, <var>[[JANUS WEB ON]]</var>, or <var>$Web_Proc_Send</var>). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by <var>$Web_Output_Content</var>.</p> | <p>'''Note:''' ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the <var>CR</var>, <var>LF</var>, or <var>CRLF</var> setting of <var>[[JANUS DEFINE]]</var>, <var>[[JANUS WEB ON]]</var>, or <var>$Web_Proc_Send</var>). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by <var>$Web_Output_Content</var>.</p> | ||
<li>Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this [[Longstrings|longstring]] using either [[List of $functions|$Lstr_xxx]] longstring parsing functions or <var>Stringlist</var> class parsing methods — the <var>[[ParseLines (Stringlist | <li>Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this [[Longstrings|longstring]] using either [[List of $functions|$Lstr_xxx]] longstring parsing functions or <var>Stringlist</var> class parsing methods — the <var>[[ParseLines (Stringlist subroutine)|ParseLines]]</var> method is likely to be particularly helpful. | ||
</ul> | </ul> | ||
Latest revision as of 16:52, 10 October 2014
Retrieve current output stream
$Web_Output_Content retrieves the current contents of the Janus Web Server output stream as a longstring.
$Web_Output_Content takes a single optional argument and returns a longstring.
Syntax
%lstr = $Web_Output_Content( [type] )
Syntax terms
type | A case-independent string set to one of the following:
type is an optional argument, and it defaults to Binary. |
---|
Usage notes
- $Web_Output_Content can be used to examine data in the Janus Web Server output stream that results from Print or Html/Text statements when web capture is on ($Web_On), or to examine data that results from $Web_Proc_Send.
$Web_Output_Content cannot examine output data in these cases:
- After a $Web_Done
- After a $Web_Proc_Send without the MORE parameter
- After a $Web_Flush
- Text data is typically translated from EBCDIC to ASCII when sent to the Janus Web Server output stream. When the Text option is used with $Web_Output_Content, the data is translated back. If the EBCDIC-to-ASCII and ASCII-to-EBCDIC translate tables are not completely symmetrical, it is possible that the results of $Web_Output_Content will not be exactly what was sent.
A particular translation problem is the pair of square bracket characters ([ ]), which has three different EBCDIC representations but only one ASCII representation. If the preferred EBCDIC square bracket values at a site are not the ones to which the default ASCII-to-EBCDIC translate table translates, the Translate tables can be modified.
Note: ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the CR, LF, or CRLF setting of JANUS DEFINE, JANUS WEB ON, or $Web_Proc_Send). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by $Web_Output_Content.
- Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this longstring using either $Lstr_xxx longstring parsing functions or Stringlist class parsing methods — the ParseLines method is likely to be particularly helpful.