Difference between revisions of "ECHO"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Evaluate expression and output result | Evaluate expression and output result | ||
Line 9: | Line 4: | ||
==Syntax== | ==Syntax== | ||
− | ECHO <exp> [,<exp>] | + | ECHO <exp> [, <exp>] |
[AT <expN>] | [AT <expN>] | ||
Line 16: | Line 11: | ||
[PICTURE <expC2>] | [PICTURE <expC2>] | ||
− | |||
− | |||
==See Also== | ==See Also== | ||
− | [[@...GET]], [[@...SAY]], [[ACCEPT]], [[INPUT]], [[SET SPACE]], [[TRANSFORM()]], [[WAIT]] | + | [[?]], [[??]], [[@...GET]], [[@...SAY]], [[ACCEPT]], [[INPUT]], [[SET SPACE]], [[TRANSFORM()]], [[WAIT]] |
==Description== | ==Description== | ||
The ECHO command evaluates the expression and displays the results on the same line, no carriage return/line feed sequence is output unless the <exp> is a character expression and contains the 'C' style escapes as shown below. If more than one expression is specified and SET SPACE is ON, a single space is output between each expression. If SET SPACE is OFF, the expressions are output with no space in between. | The ECHO command evaluates the expression and displays the results on the same line, no carriage return/line feed sequence is output unless the <exp> is a character expression and contains the 'C' style escapes as shown below. If more than one expression is specified and SET SPACE is ON, a single space is output between each expression. If SET SPACE is OFF, the expressions are output with no space in between. | ||
+ | |||
+ | The following escapes can be included in <exp> if it is a character expression: | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 37: | Line 33: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | The ECHO command also supports php-style $variable and {expression} substitutions in character strings. | ||
Line 47: | Line 45: | ||
|- | |- | ||
|FUNCTION <expC2>||The FUNCTION qualifier allows picture functions to be specified. Normally this can be done with the PICTURE qualifier by preceding the picture with '@'. If the FUNCTION qualifier is used the '@' is not needed. | |FUNCTION <expC2>||The FUNCTION qualifier allows picture functions to be specified. Normally this can be done with the PICTURE qualifier by preceding the picture with '@'. If the FUNCTION qualifier is used the '@' is not needed. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|} | |} | ||
Line 72: | Line 52: | ||
<code lang="recital"> | <code lang="recital"> | ||
echo "price" at 10 picture "@!",1234.56 picture "$9,999.99" | echo "price" at 10 picture "@!",1234.56 picture "$9,999.99" | ||
− | echo " | + | echo "-----\n" at 10 |
PRICE $1,234.56 | PRICE $1,234.56 | ||
− | ------ | + | ----- |
+ | |||
+ | // php-style $variable and {expression} substitution | ||
+ | m_date = date() | ||
+ | echo "Today's date is {m_date}\n" | ||
</code> | </code> | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
+ | [[Category:Input Output]] | ||
+ | [[Category:Input Output Commands]] |
Latest revision as of 15:53, 13 January 2010
Purpose
Evaluate expression and output result
Syntax
ECHO <exp> [, <exp>]
[AT <expN>]
[FUNCTION <expC1>]
[PICTURE <expC2>]
See Also
?, ??, @...GET, @...SAY, ACCEPT, INPUT, SET SPACE, TRANSFORM(), WAIT
Description
The ECHO command evaluates the expression and displays the results on the same line, no carriage return/line feed sequence is output unless the <exp> is a character expression and contains the 'C' style escapes as shown below. If more than one expression is specified and SET SPACE is ON, a single space is output between each expression. If SET SPACE is OFF, the expressions are output with no space in between.
The following escapes can be included in <exp> if it is a character expression:
Escape | Description |
---|---|
\t | Tab |
\n | New line |
\r | Carriage return |
The ECHO command also supports php-style $variable and {expression} substitutions in character strings.
Clause | Description |
---|---|
AT <expN> | You may optionally specify the column at which the expression will be output with the AT <expN> clause. |
PICTURE <expC1> | The PICTURE clause supports all picture template symbols listed in the @...SAY command. |
FUNCTION <expC2> | The FUNCTION qualifier allows picture functions to be specified. Normally this can be done with the PICTURE qualifier by preceding the picture with '@'. If the FUNCTION qualifier is used the '@' is not needed. |
Example
echo "price" at 10 picture "@!",1234.56 picture "$9,999.99" echo "-----\n" at 10 PRICE $1,234.56 ----- // php-style $variable and {expression} substitution m_date = date() echo "Today's date is {m_date}\n"
Products
Recital Server, Recital