Semantics : PrintStatement

PrintStatement  ::=  ( print | println | flush | . ) ( { Expr } )?
( < ( out | err | log | pipe | PrimaryExpr ) > )?
( PrintArgument ),*

Used by:  

This statement prints text content to output streams, files or pipes. The print statement does not automatically do flushing, whereas println does. flush works the same as print but flushes when printing is done. The . is a shortcut for println , since the latter is used frequently.

These print statements supports flexible formatting, as shown in PrintArgument.

The print target by default is out , which is the standard system output stream. Other system output streams are err (for error) and log (for logging). Or it can be a file, opened by openTextFile(file_name,'w') system function call, where 'w' means writing. A pipe is the input stream for a command-line; this allows programs to write input to any command-lines. See ExecStatement on this. The target can also be a simple variable, in which case the statement will print into a string stored in that variable.

If the print target is not a text output stream, it prints into a new string and assigns to the variable.