Disable

LRM §11.

Disable terminates the execution of a named group of statements before all the statements have been executed.

Syntax:

disable group_name

Description:

The disable statement discontinues execution of a named group of statements.

Disabling a named block or a task disables all tasks enabled from that block or task, and downwards through the hierarchy of enabled tasks. Execution continuous with the statement following the disabled task enable statement or named block.

A named block or task may be self-disabled by a disable statement inside that named block or task. If a task disables itself the outputs are not defined, so this is not the same as returning from that task.

Example:

begin: BreakBlock
  I = 0;
  forever begin
    if (I == A)
      disable BreakBlock;
    #1 I = I + 1;
  end
end

Notes:

See also:

Begin, Fork, For loop, Task