FUNCTION JJCTC( mode ) c. Used to set and reset the ^C processing {Abort on 5 ^Cs} c. c.In MODE -- 2:Get TT channel, 1:Get and Set CTC_prc, 0:Ret #CTC's c. +2 -- Initally to get the channel in /JJ_CTC/ jctc_chn c. +1 -- Initally to set ^C processing and get channel c. 0 -- Return the number of ^C's, and zero c. c.Out JJCTC -- The number of ^C's since the last call. {mode=0} c. The "TT" channel assigned {Mode=1,2} c. c. common /JJ_CTC/ jctc_chn, jctc_num !! TT channel, num of ^C's c---------------------------------------------------------end.of.info c.uses: JJCTCSET .. to set and reset the ^C ast c. common /JJ_CTC/ jctc_chn, jctc_num c. JJCTC = jctc_num c. if( mode.gt.0 ) then jctc_num = jctc_num+1 if( jctc_num.gt.5 ) CALL EXIT( 4 ) call JJCTCSET( mode ) jjctc = jctc_chn else if( jctc_num.gt.0 ) then JJCTC = jctc_num jctc_num = 0 endif endif c. return end SUBROUTINE JJCTCSET( mode ) c. Used to actually set the control'C c. c.uses JJCTC .. To field the ^C c. c.end.of.info c. external JJCTC external IO$_SETMODE, IO$M_CTRLCAST common /JJ_CTC/ jctc_chn, jctc_num character*20 devnam c. if( iagain.eq.0 ) then iagain = 1 jctc_num = 0 call sys$trnlog( 'TT',, devnam ,,, ) call sys$assign( devnam, jctc_chn,, ) endif if( mode.ne.2 ) then call sys$qio( , %val(jctc_chn), 1 %val(%loc(IO$_SETMODE).or.%loc(IO$M_CTRLCAST)) ,,, 2 , JJCTC, 1234 ,,,,, ) endif c. return end d PROGRAM ztest c. Test program for ^C processing c. d common /JJ_CTC/ jctc_chn, jctc_num d call JJCTC(1) d type*,jctc_chn c. d 200 continue d if( 1.eq.1 ) goto 200 !!Test 5 CTC >> abort d iret = JJCTC(0) d if( iret.ne.0 ) then d type*,'a control c was read' d type*,iret d endif d goto 200 c. d end