PROCEDURE CNCT(Task:Rad56; EFN:Event_Flag; VAR Status:SPAWN_Status_array); EXTERNAL; {*USER* CNCT will let the calling task connect to another active task for purposes of exit notification. The program using the CNCT directive (caller) will become the "parent" task, and the program named in TASK parameter will become the "offspring" task. When the offspring task exits, the parent will be notified by the setting of the event flag specified by the EFN parameter and the exit status information will be placed in the STATUS parameter. The type SPAWN_STATUS_ARRAY is defined in PAS$EXT:SPAWN.TYP. Note that the offspring task may exit at any time, so the STATUS parameter must be available to the executive. Normally this means that STATUS must be a global variable. It can also be a local variable, if you will not leave that procedure before the offspring task exits. If the parent task exits before the offspring task, the connection block will be removed from pool with no effect on the system. Once a connection is made, the parent may not remove the connection except by exiting, or by passing all current connections to another task using the RPOI directive. There is no restriction on the number of connections that can be made, including the number made to the same task. For this reason, it is important not to indiscrimately make connections to the same task, as multiple connections to the same task will increase pool consumption. Use the directive status to determine if a connection has been made. A connection is made ONLY if a success IS.SUC (1) is returned in $DSW. The only "normal" error codes are IE.INS or IE.ACT. All other errors indicate a programming error or a congested/crashing system. *STATUS CODES* 1 = successful completion (IS.SUC) -1 = insufficient pool for connection block (IE.UPN) -2 = specified task was a CLI or not installed (IE.INS) -7 = specified task was not active (IE.ACT) -97 = invalid event flag specified (IE.IEF) -98 = DPB not in user's program space (IE.ADP) -99 - DIC/DPB size is invalid (IE.SDP) }