[INHERIT('sys$library:starlet', 'sys$library:pascal$lib_routines')] PROGRAM Use_Dclexh(OUTPUT); TYPE Exit_Control_Block = RECORD Forward_Link : INTEGER; Handler_Addr : INTEGER; Parameter_Count : INTEGER; First_Parameter : INTEGER; Second_Parameter : INTEGER END; VAR Reason, Second : [VOLATILE] INTEGER; Status : INTEGER; P : ^INTEGER; Control_Block : Exit_Control_Block; PROCEDURE Exit_Handler( Reason, Second : INTEGER ); BEGIN WRITELN(' The reason is ',HEX(Reason)); WRITELN(' The second is ',Second); END; BEGIN { Fill in any fields in control_block } Control_Block := Exit_Control_Block[ Forward_Link : 0; Handler_Addr : IADDRESS(Exit_Handler); First_Parameter : IADDRESS(Reason); Second_Parameter : IADDRESS(Second); Parameter_Count : 2]; { Fill in second parameter } Second := 1010; { Establish the Exit Handler } Status := $dclexh( Control_Block ); IF NOT ODD(Status) THEN LIB$Stop(Status); { Now generate an ACCVIO to activate the handler } P := NIL; P^ := 5; END.