View previous topic :: View next topic
|
Author |
Message |
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Hi All
In my panel i am using below
)Proc
& PFKEY = .PFKEY
.Cursor = &CPOS
)END
In my Rexx program i am checking below
IF PFKEY = 'PF01 ' | PFKEY = 'PF03' | PFKEY = 'ENTER' THEN
say 'Valid key'
ELSE
say 'Invalid key'
The problem is even when i am pressing enter its saying invalid key.And when i am pressing PF1 its going in ISPF help.However its working fine for PF03
Please suggest. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
What exactly are you trying to achieve ?
If you want to mess about with PF keys take a look at using KEYLIST. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Thanks for reply expat!!!
Code shown above is just for easy understanding of problem i am facing actually i will be validatning the response from user here.
I dont want user to press any key other than these else i will throw message.
But as mention in first post enter and PF03 r not working. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
As I said, if you want to change the functioning of PF keys you need to define and use a KEYLIST.
I would recommend doing any validation in a REXX loop
Code: |
DO FOREVER
"ISPEXEC DISPLAY PANEL(your panel)"
IF RC = 8 THEN LEAVE /* PF3 */
your validation code
...
...
...
END |
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
trushant.w wrote: |
Thanks for reply expat!!!
Code shown above is just for easy understanding of problem i am facing actually i will be validatning the response from user here.
I dont want user to press any key other than these else i will throw message.
But as mention in first post enter and PF03 r not working. |
No, you mentioned that PF1 was not working, not PF3.
Take a moment to actually think about what you're doing:
- ENTER is not a PF key
- PF keys have ISPF commands associated with them. The HELP command does not terminate panel processing, so your Rexx code never gets control.
- The END command does terminate processing. If you assigned to a different PF key, though, that one would terminate the processing.
Bottom line: use panel Rexx or DMS to do what you want, not external code. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
" i will be validatning the response from user here". Why re-invent the wheel ? Look up the VER statement in ISPF Dialog Developers Guide & Reference. That gives automatic validation of user input. You'll already have hundreds of examples in your ISPPLIB concatenation at your site. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Yes Akatsukami by mistake i said that PF03 is not working in my second post.Only PF01 and ENTER are not working.
I will be doing other processing as well after recognizing what key is pressed by user hence i have to code this in Rexx. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Code: |
)Proc
& PFKEY = .PFKEY |
As Akatsukami mentioned, Enter is not a PF key. For Enter, use .RESP instead of .PFKEY.
You should let ISPF handle the HELP processing. If you do not want ISPF to handle HELP, you need to use an application command table. Specify HELP as PASSTHRU. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
I dont want user to press any key other than these else i will throw message. |
I agree with Expat that you should consider the use of a keylist which helps you enable/disable PF keys. However, the user can always use the KEYLIST command to create a private copy which he can customize.
Even without using a keylist, the user can reassign the value of the key using the KEYS command.
But, just to be clear, The number of the key used should not be important. What is important is the command it represents. If you want to disable commands, you need to create an application command table and set those commands to PASSTHRU. Instead of checking which key was used, check ZCMD and ZVERB variables.
It is not clear why you want to prevent PF1. It is an awkward user interface to not allow a help facility. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Hi Pedro
I want to prevent PF01 bcoz i want to throw my own cereated help panel instead of ISPF panel. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
trushant.w wrote: |
Hi Pedro
I want to prevent PF01 bcoz i want to throw my own cereated help panel instead of ISPF panel. |
So? Go read up on the .HELP variable. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
I would like to commend the TS for wishing to provide HELP. Too many dialog authors do not go to the trouble of doing that. ISPF has made it very easy to provide, at the very least, a rudimentary form of help. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Thanks for ur replies
I got the solution to recognize enter.Below is the code
IF PFKEY = '' ...........
But i am still struggling with PF01.Whenever i m pressing PF01 i m going in ispf help
Pedro
I have searched for the PASSTHRU as u suggested but couldnot got much help.
Can u throw som more light on it. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
- Create your help panel. Assume for the sake of discussion that it is named PH, in a library concatenated to ISPPLIB.
- In the )INIT section of your main panel, add the line
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
I got the solution to recognize enter.Below is the code |
I do not think that is adequate.
In the )PROC section of your main panel, add the line:
and in your rexx, check the RESPONSE variable. It should be either ENTER or END. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
Can u throw som more light on it. |
Please do not use chat slang. This is a technical forum and your questions need to be somewhat precise. Also, many of the readers are English as a second language. And it is unprofessional. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
My suggestion should not apply to HELP, as you should be using the .HELP function as described by Akatsukami-san.
My suggestion for PASSTHRU was in response to your description of disabling most of the function keys. Use ISPF option 3.9 to create an application command table. When you start your rexx program make sure you get into the same APPLID as when you defined the application command table.
Quote: |
I have searched for the PASSTHRU as u suggested but couldnot got much help. |
It is not clear where you searched, but you should search in ISPF Dialog Developers Guide and Reference, as well as ISPF User's Guide Vol II, and ISPF User's Guide Vol I. Search for PASSTHRU and command table, and NEWAPPL. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Actually, searching in ISPF Planning and Customizing is better. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Thanks for your replies.
Pedro i noted your point.
I did implement my help panel as suggesed by ataksukami.
But the problem is after displaying my help panel i am not able to comeback to my main panel. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Can you explain what happens in more detail?
Issue ISPDPTRC before starting your panel. THen issue ISPDPTRC again after the failure. Show us the trace output. |
|
Back to top |
|
|
|