HP3000-L Archives

April 2005, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Brian Donaldson <[log in to unmask]>
Reply To:
Brian Donaldson <[log in to unmask]>
Date:
Sat, 9 Apr 2005 15:38:27 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
I have been having a slight problem with the trapping of Control-Y in a
subroutine.

I have my own suspicions why it isn't working and I hope someone on the
list can verify my suspicions...

Cobol mainline calls a Cobol subroutine. The Control-Y trap in the main
works perfectly every time -- press Control-Y and the program stops via the
Control-y trap. Perfect! Just what I want.

The same mainline calls a subroutine that does a chain of DBGET mode5's
thru 2 different data sets. So while it is going thru these loops I press
control-Y and nothing happens until control returns to the mainline, then
the control-Y trap is recognized....

My logic for trapping Control-Y is identical in the main and the subroutine.

My suspicions about why it works in the main and not in the sub is this --
(PLABEL is pointing to the wrong program name?)

Code sample to initialize for the Control-Y trap:

     CALL INTRINSIC "HPGETPROCPLABEL" USING WS-CTRLY-PROCNAME,
                                            WS-CTRLY-PLABEL,
                                            \\,
                                            WS-HPMYPRG-NAME.
     CALL INTRINSIC "XCONTRAP" USING WS-CTRLY-PLABEL,
                                     WS-CTRLY-OLD-PLABEL.
     SET CTRLY-RESET TO TRUE.
     MOVE SPACES     TO WS-CTRLY-HIT.

The field "WS-HPMYPRG-NAME" is obtained via the MPEiX
intrinsic "HPMYPROGRAM". Even in the subroutine it is returning the program
name of the MAINLINE not the subroutine! (I really don't want to be
hardcoding program names into my source code).

Regardless of what I have tried the Control-Y trap is not being recognized
until program control returns to the mainline. I would much prefer the
Control-Y trap to be enabled and trapped in the sub as well as the main.

I tried hardcoding the name of the sub in the paragraph that does the
Control-Y trap initialization but it still doesn’t work until control
returns to the mainline.

Does anyone on the list have an idea why this is not working in the sub?

TIA,
Brian.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2