| GOLF(2gg) | Development | GOLF(2gg) |
NAME¶
output-statement - (output)
PURPOSE¶
Output text.
SYNTAX¶
@<text> !<verbatim text>
DESCRIPTION¶
Outputting free form text is done by starting the line with "@" or "!". The text is output unencoded with a new line appended.
With "@" statement, any inline-code executes and any output from those statements is output.
With "!" statement, all text is output verbatim, and any inline code is not executed. This is useful when the text printed out should not be checked for any inline-code.
All trailing whitespaces are trimmed from each source code line. If you need to write trailing whitespaces, with "@" statement you can use print-out as inline-code. Maximum line length is 8KB - this is the source code line length, the actual run-time output length is unlimited.
Note that all characters are output as they are written, including the escape character (\). If you wish to output characters requiring an escape character, such as new line and tab (as is done in C by using \n, \t etc.), use print-out as inline-code.
EXAMPLES¶
Outputting "Hello there":
@Hello there
You can use other Golf statements inlined and mixed with the text you are outputting:
set-string weatherType="sunny" @Today's weather is <<print-out weatherType>>
which would output
Today's weather is sunny
With "!" statement, the text is also output, and this example produces the same "Hello there" output as "@":
!Hello there
In contrast to "@" statement, "!" statement outputs all texts verbatim and does not execute any inline code:
set-string weatherType="sunny" !Today's weather is <<print-out weatherType>>
which would output
Today's weather is <<print-out weatherType>>
SEE ALSO¶
Output
finish-output flush-output output-statement print-format print-out print-path See all documentation
| $VERSION | $DATE |