Write string to stdout

Updated November 2014; see History

xcall CGIUTL, CGIOP_STDOUT, string, status

Opcode 4, CGIOP_STDOUT writes string to stdout.

Parameters

string  (String)  [in]

The text to be output to the browser. A CRLF is appended to the string, analogous to a PRINT statement.

status (Signed Num)  [out]

On success, returns the number of bytes output. Negative values represent system error codes.

Comments

Use this in place of PRINT statements to output individual characters or lines to the new web page. (In -cgi mode, the output of PRINT statements is sent to the stderr stream rather than stdout. For more information, see the A-Shell command line switch CGI.)

History

2014 November, A-Shell 6.1.1395:  Binary output is now supported, specified variable must be type X. This provides the possibility of an A-Shell CGI program rendering a download to the browser. Which has some security advantages over statically storing the file to be downloaded and letting the web server handle it directly.