Function: Text
Function: Text

Function: Text

Text ( MESSAGE )

Adds a TEXT cue to the response, which contains text to output.

Parameters

Parameter Type Description
MESSAGE VALUE(STRING) The message to output.

Returns

Returns nothing. Cannot be used in expressions.

What It Does

Prints a message to the screen. Be aware that the text printed does not automatically have a newline at the end.

Specifically, this adds a TEXT cue to the response with the provided message as the content. Processing a TEXT and TEXTF cue is meant to print something to the screen in all TAME Shells. The input parameter is transformed to a string, no matter what value type it originally is.

This is a convenience function, and is functionally equivalent to:


	addCue("text", message);

It is up to the TAME shell to determine how to render the text. Authors should not use the text functions to meticulously lay out text, for example: adding whitespace in order to get text to appear in a specific location on the screen. If a TAME shells has a method for doing this sort of thing, that should be employed rather than relying on the behavior of a specific medium. Authors should also be aware about shells that employ use of different fonts or other textual effects.

All TAME shells accumulate TEXT and TEXTF cue output as through it were printed in one block. Other cues like WAIT and PAUSE do not interrupt this behavior, unless the handling of a cue requires output to the same place that text will also be output to, but for the most part, you can rely on behavior like newlines terminating a paragraph or line.

Example

Text Example


world
{
	start()
	{
		text(8 + 3);
		// newline after
		text("\n");

		// with newlines
		text("apple\n");

		// without newlines
		text("apple");
		text("orange");
		text("pear");
		text("grape");
		quit;
	}
}

See Also

AddCue() — Adds cues to the Response.

Additional Technical Notes

Strings in TAME are Unicode, so most characters should output how the author intends, but that may also depend on locale, encoding, or the Shell used for displaying. The Java and Browser JS implementations contain ways to easily parse formatted text.

×

Modal Header