# clear

The keyword is used to remove the contents of the incoming queue of the specified communication port.

- The operation is valid for both message and procedure based ports.
- It is possible to clear all defined ports.
- If the port queue is already empty then this operation has no action.

Related keywords:

- all
- port

### port_reference.clear;

- port_reference points out the port to be cleared.

  - the keywords all port may be used to indicate that all defined ports must be cleared (see the example 2).

- The clear keyword introduces port cleansing.

Example 1:

Kapu_PCO.clear;

The port Kapu_PCO will be cleared.

Example 2:

all port.clear;

The incoming queues of all defined ports will be emptied.

BNF definition of clear