echo()

Function usage:

ECHO(text [, attrs [, inline [, dest]]])

Command usage:

/ECHO [-p] [-aattrs] [-e] [-w[world]] text
/_ECHO text


Displays text on the tfout stream (i.e., the screen, usually), unless otherwise redirected by options.

Options and arguments:

command: -aattrs
function: attrs
Echo text with the attributes given by attrs.
command: -p
function: inline = "on" or 1
Interpet @{attr} strings as commands to set attributes inline. "@@" strings are interpreted as "@". "@{n}" or "@{x}" will turn attributes off.
command: -wworld
function: dest = "wworld"
Echo text to the world stream instead of the default tfout stream (see tfio). If world is blank, the current world is assumed.
command: -e
function: dest = "e"
Echo text to the tferr stream, instead of the default tfout stream (see tfio).
function: dest = "o"
Echo text to the tfout stream (the default).

The command form is usually more convenient, but the function form is the only way to echo text with leading or trailing spaces. Remember that "-" by itself can be used to mark the end of command options, in case text begins with "-".

/_echo is more efficient than /echo, so it is better for use in heavily used macros that don't need all the options of /echo.

Example: Both of these commands

  /test echo("@{u}Hello@{n}, world!", "B", 1)
  /echo -aB -p @{u}Hello@{n}, world!
echo the following line, with "Hello" underlined, and the whole line bold:
  Hello, world!

Echoed text is not matched against triggers. To do that, use /trigger.

See: attributes, worlds, fwrite(), pad(), tfio


Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys