)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
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Fri Jun 13, 2008 8:37 am Post subject:
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.
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Fri Jun 13, 2008 1:15 pm Post subject:
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.
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