Coroutines

A coroutine is a procedure that is initiated as a separate task by using a CALL statement. The caller is referred to as the primary coroutine and the called procedure as the secondary coroutine.

Because the execution of CONTINUE statements causes control to alternate between primary and secondary coroutines, processing always continues at the point where it last terminated.

The secondary coroutine uses the CONTINUE statement form without the task designator to pass control back to its partner task, which is the primary coroutine by default. The task designator is used by the primary coroutine to pass control to the secondary coroutine associated with that task designator by the CALL statement. For more information, refer to CALL Statement.