19.0.0 released Nov 08, 2023
Output statement

Purpose: Output text.


!<verbatim text>

Outputting free form text from Vely code is done by starting the line with "@" or "!". The text is output unencoded to the client 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 (such as << ... >>).

All trailing whitespaces are trimmed from each source code line. If you need to write trailing whitespaces, with "@" statement you can use p-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 p-out as inline-code.
Outputting "Hello there" from Vely code:
@Hello there

You can use other Vely statements inlined and mixed with the text you are outputting:
char *weatherType="sunny";
@Today's weather is <<p-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:
char *weatherType="sunny";
!Today's weather is <<p-out weatherType>>

which would output
Today's weather is <<p-out weatherType>>

See also
See all

You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a dofollow link back to this page - see full license at CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind. Icons from table-icons.io copyright PaweĊ‚ Kuna, licensed under MIT license.