[Info-vax] F6 and ctrl-C

Joukj joukj at hrem.nano.tudelft.nl
Mon Jul 12 09:41:12 EDT 2021


Arne Vajhøj wrote:
> On 7/9/2021 2:35 AM, Joukj wrote:
>> Dave Froble wrote:
>>> On 7/8/2021 7:37 PM, Jan-Erik Söderholm wrote:
>>>> It seems as PF6 and PF10 are linked to Ctrl/C and Ctrl/Z.
>>>> At least as it says in the OpenVMS User Manual:
>>>>
>>>> Ctrl/Z and F10 Signals the end of the file for data entered from the
>>>> terminal.
>>>>
>>>> Ctrl/Y, Ctrl/C and F6 Interrupts command processing. You can disable
>>>> Ctrl/Y with the command SET NOCONTROL=Y.
>>>
>>> Basic allows ^C to be trapped and handled in a program.  Perhaps 
>>> Cobol also has this capability.
>>>
>>> As Steve sometimes mentions, terse questions beget terse answers.  
>>> Can you be more specific on how you're handling the terminal I/O ?
>>>
>> All languages should be able to do it by a call to sys$qiow
> 
> lib$disable_ctrl and sys$qiow with 
> IO$_SETMODE|IO$M_CTRLCAST|IO$M_CTRLYAST ?
> 
> Arne
> 
I used only sys$qiow to catch CTRL-C and run my own handler.(see fortran 
code I wrote over 30 years ago)

       include '($iodef)/list'
       structure /iostat_block/
         integer*2 iostat
       end structure
       record /iostat_block/ iosb
!
       integer status , code
       integer*2 input_chan
!
       integer ( kind = kind_i4 ) , external :: sys$assign , sys$qiow
!
! the handler routine
       external ctrlc_ast
!
       status = sys$assign( 'sys$input' , input_chan , , )
       code = io$_setmode .or. io$m_ctrlcast
       status = sys$qiow( , %val( input_chan ) , %val( code ) ,iosb &
              , , , &
              ctrlc_ast , , , , , )
       if(.not. status) call lib$signal(%val(status))
       if(.not.iosb.iostat) call lib$signal(%val(iosb.iostat))



            Jouk



More information about the Info-vax mailing list