[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Wed Jan 22 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

135.0. "ON CONTROL_Y also traps CTRL/C ?" by TKTV20::HASHIMOTO () Mon Feb 03 1997 21:59

One of my customer wants to trap CTRL/Y in a command procedure.
He was trying ON CONTROL_Y command, but he found that the command also
catches CTRL/C although online-help does not mention about CTRL/C.
He is working on V6.1 of OpenVMS Alpha.

My questions are:

1. Is this an officially correct function which ON CONTROL_Y command has ?
2. How can he control CTRL/Y or CTRL/C separately in a command procedure ?

Thanks in advance,

CSC-Tokyo
Junshi

$!
$! This is a sample procedure to reproduce the problem.
$!
$ On CONTROL_Y Then GoTo CTRL$Y
$ Set On
$
$ LOOP:
$   Wait 00:00:02
$   Show Time
$ GoTo LOOP
$
$ CTRL$Y:
$ Write SYS$OUTPUT "CTRL/Y ( or CTRL/C ? ) pressed"
$ Exit
T.RTitleUserPersonal
Name
DateLines
135.1POMPY::LESLIE[email protected] as of Feb 14Tue Feb 04 1997 02:536
    1) Dunno about official, but it's been this way for a very long time.
    I'm not sure dcl differentiates between CTRL_C and CTRL_Y at all.
    2) He can't that I know of. 
    
    You may wish to try the EPS::COMMAND_PROCEDURES and NOTED::HACKERS
    conferences for workarounds etc.
135.2See HELP SET CONTROLGREGOR::OPPTue Feb 04 1997 08:005
    	Refer also to HELP SET CONTROL.  You may be able to develop
    a 'hack' that works for your specific application.
    
    Greg
    
135.3QAR The DocsXDELTA::HOFFMANSteve, OpenVMS EngineeringTue Feb 04 1997 09:2817
:1. Is this an officially correct function which ON CONTROL_Y command has ?

   Yes, this is expected and long-standing behaviour of DCL.  Log a
   QAR against the DCL dictionary and the user's manual, as both do
   not clearly document this behaviour.  (One has to read through
   the fine print in the terminal driver section -- if no <CTRL/C>
   AST is enabled, the terminal driver converts a <CTRL/C> to a
   <CTRL/Y> -- in the I/O user's manual to learn of this behaviour.)

:2. How can he control CTRL/Y or CTRL/C separately in a command procedure ?

   DCL processes both interrupts -- <CTRL/Y> and <CTRL/C> -- the same,
   it establishes no <CTRL/C> handler.  Images can choose to behave
   differently, and can establish -- via calls to the terminal driver
   and a call to the run-time libraru LIB$ENABLE_CTRL routine.

135.4AUSS::GARSONDECcharity Program OfficeTue Feb 04 1997 17:1121
    re .*
    
    Note also that the terminal driver echoes CTRL/C in a context specific
    way. That is, if no CTRL/C handler is enabled, CTRL/C is echoed as a
    CTRL/Y (Interrupt) and processed as one. If a CTRL/C handler is
    enabled, CTRL/C is echoed as Cancel. (Try for example pressing CTRL/C
    while TYPEing a longish file.)
    
    DCL is blameless and it is not surprising that DCL documentation
    doesn't cover this.
    
    I can't see any easy way of achieving separate CTRL/C processing in a
    DCL command procedure and DCL would not want to have an unconditionally
    enabled CTRL/C handler itself since that would break lots of applications
    that have their own handler.
    
    You may have to change the "user interface" to take account of this
    behaviour of the terminal driver e.g. have CTRL/Y handling ask
    indirectly whether Y or C was required, or e.g. require two CTRL/Y
    presses in reasonably quick succession to get the CTRL/C behaviour (but
    that won't work too well if logged in via SET HOST).
135.5TKTV20::HASHIMOTOWed Feb 05 1997 19:551
Thank you for your many precious information. They help me a lot.