MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using PFKEY In Rexx

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
nccosta
Beginner


Joined: 06 Jan 2006
Posts: 4
Topics: 3

PostPosted: Fri Jun 13, 2008 8:07 am    Post subject: Using PFKEY In Rexx Reply with quote

nccosta wrote:
Hello

I wonder to do to capture and redefine the PFKEYS Panel in PDF that I am mounting.

Follow the example of what I want to do.

From

F1=Help F2=Split F3=Exit F7=Backward F8=Forward F9=Swap
F10=Actions F12=Cancel

To

F1=Help F2=Split F3=Exit F4=Clear F5=Define F9=Swap
F10=Actions F12=Cancel

PANEL


)ATTR
_ TYPE(INPUT) INTENS(HIGH) COLOR(TURQ) CAPS (ON)
! TYPE(INPUT) INTENS(HIGH) COLOR(YELLOW) CAPS (ON)
# TYPE(OUTPUT) INTENS(HIGH) COLOR(RED) CAPS (ON)
@ TYPE(OUTPUT) INTENS(HIGH) COLOR(YELLOW) CAPS (OFF)
)BODY LMSG(LONGA)
%PRODUCAO+- A R C H G E N E R + &ZDATE &ZTIME
%COMANDO ===>_ZCMD +CC-SUPORTE
@LONGA

+
+ DATA SET NAME ........: _DSNAME +
+
+
+
+
+
+
+
% %PF3+FIM %PF04+Clear %PF05+Define
)INIT
.CURSOR = DSNAME
)REINIT
REFRESH(*)
)PROC
VER (&DSNAME,NONBLANK)
)END


REXX

Trace ?r

Screen:

Do Forever

Address Ispexec 'Display Panel(Rxarch)'

If PFK = PF03 Then Exit
If PFK = PF04 Then Clear
If PFK = PF05 Then Define
If Rc = 0 Then Call Processa_Pedido

End

Exit 4
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Jun 13, 2008 8:37 am    Post subject: Reply with quote

You cannot access the PF keys from Rexx - ISPF intercepts them and produces a return code when it returns control to Rexx. I don't thnk you can capture the PF key within ISPF itself - it is all done behind the scenes by the ISPF 'engine' otherwise you could have set a variable to say which key was pressed and process according to the value stored in that variable.

PF3 is the standard ISPF exit key unless redefined. It will give a rc=4 which allows you to get out of your DO FOREVER.

Enter will give you an RC=0.

What do you mean by 'Clear' and 'Define'

Why exit with a return code of 4? Normally that means that something did not function quite right.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jun 13, 2008 1:15 pm    Post subject: Reply with quote

ISPF applications should never look for individual PF keys. I'm sure someone will respond with advice to use &ZPF01 or similar (without using a separate applid), but don't do it. Users can change PF keys and as Nic says, you may never see the results of a key press.

Instead, check the return codes from DISPLAY for END or ENTER and check the value of your command line for anything else. In other words, if you need 'DEFINE' as a verb, run your application in a separate application id (SELECT CMD(xxx) NEWAPPL(YYY)) and then define a default set of keys with either a keylist or an initial profile (table member YYYPROF in the above example). In this case, one of the keys would be assigned the value DEFINE. The easiest way to create a profile member is to start ISPF from the Ready prompt with the new appl id (ISPF PANEL(ISR@PRIM) NEWAPPL(YYY) ) type KEYLIST OFF followed by KEYS and set up the keys as you want the user's defaults to be, then end ISPF and go back in without the NEWAPPL(YYY) and copy the YYYPROF to a tables data set you can then use LIBDEF ISPTLIB to access when they start your application. Alternatively, if you are starting your application with your own applid, you can initialize the PF keys by VPUT of ZPF01 through ZPF24 but doing so risks ruining users' normal PF key settings if they are not running your application in the right applid. Note, of course, your program can check the applid (&ZAPPLID) before making such changes.

One last tidbit of trivia... If you want your keys to pass in a value that is already in the ISPF command table, such as EXIT or PRINT, preceed the key value with a > sign, such as >EXIT r >PRINT
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group