View previous topic :: View next topic |
Author |
Message |
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Thu Jan 16, 2003 6:02 am Post subject: How to trap the PF key that was entered on the ISPF screen |
|
|
Hi,
I want to trap the PF key in the REXX program that was entered on the ISPF(SDF-ii) screen.. based on that I want to perform some operations..
Basically.. I want to display the screen as along as he presses other than PF3 key.. But at present, whenever I press enter button , the screen getting disappeared.. I want logic something, which should continuously display the screen until he presses the PF3 KEY..
I was searching for this topic in this forum.. But I couldn't get that..
Please provide me the some logic.. |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Jan 16, 2003 6:17 am Post subject: |
|
|
The ISPF global variable ZPFKEY contains the last pressed PF key. You can check that in your REXX routine.
Regards,
Manas |
|
Back to top |
|
|
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Thu Jan 16, 2003 10:59 am Post subject: |
|
|
Besides ZPFKEY, I also use PFK which works. Below is an example.
[code:1:b7a1ebc235]
IF ZCMD = STOP | RC |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Fri Jan 17, 2003 6:45 am Post subject: |
|
|
Hi Captbill,
I tried the option in following way..
DO WHILE ZPFKEY |
|
Back to top |
|
|
Dummy Beginner
Joined: 03 Jan 2003 Posts: 8 Topics: 1
|
Posted: Fri Jan 17, 2003 7:19 am Post subject: |
|
|
Hi Anand,
Try adding "ispexec vget (zpfkey ) " in the WHILE loop |
|
Back to top |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Fri Jan 17, 2003 7:37 am Post subject: |
|
|
It should probably be a "do until" loop, seeing as you don't want to test the PFKEY until after then panel has been displated. _________________ Dave Crayford |
|
Back to top |
|
|
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Fri Jan 17, 2003 11:27 am Post subject: |
|
|
Anand,
In my original posting I said I used PFK, but you used ZPFKEY. I can only speak on what I use and know it works. Try PFK and let me know the results of that. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Jan 17, 2003 11:34 am Post subject: |
|
|
All the builtin ISPF variables start with "Z". If ISPF is setting one called PFK then that is APARable because all variable names that do not start with "Z" are reserved for user dialogs. I suspect PFK is set by your own programs. |
|
Back to top |
|
|
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Fri Jan 17, 2003 12:00 pm Post subject: |
|
|
I think this is the reason PFK works.
In the panel definitions I have
Code: |
)PROC
&ALRM=NO
&PFK = .PFKEY
|
I admit I am not an expert on this sort of thing. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Fri Jan 17, 2003 12:30 pm Post subject: |
|
|
Dave,
To add to Dummy's request, I am displaying the panel in a DO FOREVER loop (using "ISPEXEC CONTROL DISPLAY LOCK" - Animation Panel). Now, I need to do two operations depending on the key pressed. Suppose I press PF3 the control should come out of the Loop and the program ends. This can be accomplished as per the previous posts. But, If I press PF5 / PF6 the control should perform some other operation and come back to the loop (DO FOREVER) loop and redisplay the PANEL. In this case, the value stored in the ZPFKEY variable remains as it is. ie. ZPFKEY contains PF5 (last PF key pressed) and so the control comes out of the loop and performs the operation (said above) again and again which should not happen. I tried to use VPUT on the ZPFKEY to reinitialize the contents of that variable but since, it is a System variable I was not allowed to do so. Now, How do I get around this problem ?
Please advise.
Thanks,
Navin. J |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Mon Jan 20, 2003 9:10 am Post subject: |
|
|
Hi Dummy,
I tried as u told.. but it's not working.. Once I press the enter button the screen getting disappeared( same as previous)..
DO WHILE ZPFKEY |
|
Back to top |
|
|
miboy Beginner
Joined: 10 Jan 2003 Posts: 13 Topics: 0
|
Posted: Mon Jan 20, 2003 1:51 pm Post subject: |
|
|
Hi Anand
Method 1
DO Until RC <> 0
"DISPLAY PANEL (D@VFS) "
END
When u press PF03/PF12, a return code of 8 is set, that would get u out of the loop
Method 2
In ur ISPF panel Code
)PROC
&PFKEY = .PFKEY
and in ur program do the following
DO WHILE PFKEY |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon Jan 20, 2003 6:06 pm Post subject: |
|
|
I'm guessing that you phrased the original question incorrectly. Is it really that you want to display the screen untill they press PF3 or until they press whatever key is assigned to END or RETURN or use a jump function? That is how ISPF applications normally work. You never check the specific key because users remap keys. Check for a return code of 8 or higher to see if an END key was pressed (or simulated) or if an error occurred. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Mon Jan 20, 2003 11:05 pm Post subject: |
|
|
Hi everybody,
My question still remails unanswered. The problem I'm facing is that, I want to perform the DO loop again. i.e After a particular Key is pressed, the control is transferred to some perform some processing and comes back to the loop and should continue the operation again. i.e I want to simulate thw WHILE (!kbhit()) sort of thing which is available in C language. i.e perform some display operation (Animation) until the user presses any key and When a key is pressed perform the function mapped to that key and come back. The problem is that the ZPFKEY value is retained forever and so, when the control comes back to the loop where I will be checking for the key press, this value is taken and the control comes out of the loop. How do I get around this problem.
Please Advise. |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Tue Jan 21, 2003 11:26 am Post subject: |
|
|
Hi Miboy,
First method is working.. But i tried last one.. still that was mystery..
Anyhow..Thanks a lot for ur response.. |
|
Back to top |
|
|
|
|