>>-LINEOUT(--+------+--+--------------------------+--)---------><
+-name-+ +-,--+--------+--+-------+-+
+-string-+ +-,line-+
0 if successful in writing string to the character output stream name, or 1 if an error occurs while writing the line. (To understand the input and output functions, see Chapter 14, Input and Output Streams.) If you omit string but include line, only the write position is repositioned. If string is a null string, LINEOUT repositions the write position (if you include line) and does a carriage return. Otherwise, the stream is closed. LINEOUT adds a line-feed and a carriage-return character to the end of string.
1 for line refers to the first line in the stream. Note that, unlike CHAROUT, you cannot specify a position beyond the end of the stream for non-binary streams.
0. If you specify neither line nor string, the stream is closed. Again, the function returns 0.
1, that is, the residual count of lines written.
Example 7.53. Builtin function LINEOUT
LINEOUT(,"Display this") /* Writes string to the default */
/* output stream (usually, the */
/* display); returns 0 if */
/* successful */
myfile = "ANYFILE.TXT"
LINEOUT(myfile,"A new line") /* Opens the file ANYFILE.TXT and */
/* appends the string to the end. */
/* If the file is already open, */
/* the string is written at the */
/* current write position. */
/* Returns 0 if successful. */
LINEOUT(myfile,"A new start",1) /* Opens the file (if not already */
/* open); overwrites first line */
/* with a new line. */
/* Returns 0 if successful. */
LINEOUT(myfile, ,1) /* Opens the file (if not already */
/* open). No write; sets write */
/* position at first character. */
LINEOUT(myfile) /* Closes ANYFILE.TXT */
Example 7.54. Builtin function LINEOUT call
Call LINEOUT "A:rexx.bat","Shell",1 Call LINEOUT ,"Hello"
Note