ABORT Statement

<abort statement>

── ABORT ─┬───────────────────────────────┬─┬───────────────────────┬──┤
          └─ [ ── <task identifier> ── ] ─┘ └─ <string expression> ─┘

Explanation

The ABORT statement

  • Discontinues a task, or a job, and any tasks initiated by the job.

  • Discontinues a task associated with the task identifier specified in the ABORT statement.

  • Discontinues a job and all the tasks initiated by a job if a task identifier is not specified in the ABORT statement.

  • Displays up to a maximum of 430 characters of the value of the string expression prior to the abort, if the string expression is specified in the ABORT statement.

  • Accepts up to 1799 characters.

Examples

The following are examples of the ABORT statement:

ABORT;
ABORT "THIS JOB HAS BEEN ABORTED";
IF T(TASKVALUE)=5 THEN ABORT;

In the following example, if the TASKVALUE attribute of task T2 has the value 3, the task associated with the task identifier T1 is discontinued after the message “TASK ABORTED” is displayed:

IF T2(TASKVALUE) = 3 THEN ABORT[T1] "TASK ABORTED"; 

In the following example, if the task state of the task T is not COMPILEDOK, the job is discontinued, or in the case of an asynchronous subroutine, the subroutine is discontinued:

IF T ISNT COMPILEDOK THEN ABORT[MYSELF];