when Command

The when command executes commands on given event.

Syntax

The when command has the following general syntax:

when event-specification [ modifier ]{ command ... ; }

When the specified event occurs, the commands are executed.

The following specific syntaxes are valid:

when at line { command; } Execute command(s) when line is reached.
when in procedure { command; } Execute command(s) when procedure is called.

where:

line is the number of a source code line.

command is the name of a command.

procedure is the name of a procedure.

For a list and the syntax of all events see Event Specification and Event Specification Modifiers.

For a general discussion of event management commands see Events.

See wheni Command for executing commands on given low-level event.