Attachment of Interrupts

Although different interrupts can be simultaneously attached to the same event, a particular interrupt can be attached to only a single event at any one time. For this reason, if, at attach time, the interrupt is found to be already attached to an event, then it is automatically detached from the old event and attached to the new event. Any pending invocations of the interrupt are lost.

An interrupt can be attached to an event that is declared in a different block. For example, a local interrupt can be attached to a formal event. Such an attachment can cause compile-time or run-time up-level attach errors if the block containing the event can be exited before the block that contains the interrupt is exited.

Event-valued file attributes are allowed. If the file is declared (or specified as a formal parameter) at least as global as the interrupt, then run-time checking can be bypassed.

However, the operating system can prevent some attachments at run time. For example, the INPUTEVENT of a remote file is available only after the file has been opened with an OPEN statement. In the operating system, run-time verification that an interrupt is not declared more global than the event always fails for attribute events. This causes a task fatal UP LEVEL ATTACH error. Therefore, a formal parameter event whose actual parameter is a file attribute cannot be attached, nor can an attribute of a formal parameter file be attached, to a global interrupt.

Imported events and event arrays cannot be used as <event designators> in an ATTACH statement.