INPUT /  OUTPUT /  LANGUAGE






clear tag

Category: ephemeral logic tag

Clears the parent field.

Sample usage

<clear>

Fields

Behaviour

This tag's Behaviour is equivalent to using the .clear operator on the parent field. It clears the contents of its immediate parent field, and the tag's lifetime then ends.

For example, using the <clear> tag at the top level is equivalent to using <console.clear>, and clears the entire contents of the console.

The onClear event will be invoked on the parent field, if it is defined. Otherwise the onCommit event will be invoked if it is defined.

Example

The following example shows how a program might create a box on the screen to display log messages, and open up a 'push environment' where, for a while, all output from the program goes into that box.

At some point, the program wants to clear the log messages, so it outputs <clear>, and the primary field of the box is cleared ready for fresh log messages.

<logOutput:box>

. . .  <! stuff happens here !>

<logOutput.push {

. . .

Creating user account...</n>
Loading game matrix...</n>
Building world...</n>
Prepare for battle...</n>
<clear>
Welcome Player One.
Target approaching.

. . .

}>