IB Statements/terminate

From CometWiki

Jump to: navigation, search

TERMINATE statement

Syntax: TERMINATE partition [,EXCP=statement-label]

Discussion: The TERMINATE statement terminates a partition. The program running in the specified partition is stopped and the partition is forced to run the QMONITOR program. The partition parameter is a string value (constant or variable) in the form "Pnn" (where "nn" is a value from 00 to 99).

The TERMINATE statement is similar to the KILL statement, but does not override the exception handling routines for the partition (like KILL does). In this sense, KILL is more powerful than TERMINATE.

TERMINATE closes all files for the named partition.

Note: Terminating an escape-protected partition (i.e., one where there is an ESCAPETO or ESCAPESUB instruction in force) causes the target partition to branch to the escape address.

Also see ACTIVATE.

Example 1: TERMINATE "P05",EXCP=9000

In the above example, partition P05 is terminated. The program running in partition P05, if any, is terminated and the partition is forced to run the QMONITOR program.

Example 2:


In this example, a user-supplied partition name is terminated. This program displays a prompt, then accepts input into a variable named PART$. The value entered by the user will be substituted into the TERMINATE statement and the program running in that partition (if any) will be terminated.

Personal tools