Not getting keystroke values from ISPF popup panel



IBM's Command List programming language & Restructured Extended Executor

Not getting keystroke values from ISPF popup panel

Postby nikesh_rai » Sat Jun 16, 2018 2:29 pm

Hi Friends,

I am trying to write a ISPF popup panel to display messages. And when I will press PF3 or ENTER key, popup screen should be closed and control should return back to the main panel.
However, during debug I saw that popup panel is not identifying or capturing keystrokes for PF3 and ENTER. Could you please help me for this issue.

part of REXX code:


ARG R,DISDATE,DISTIME,KEY,RES,A,PDS,KEY1    

DO UNTIL INVLD_OP = 0
  INVLD_OP = 0

  IF  (KEY = PF03) THEN
  DO
    EXIT
  END

  SELECT
   WHEN R = '1' THEN
        DO
          ADDRESS ISPEXEC
          "DISPLAY PANEL(FLUPLDPN)"
          "SETMSG MSG(ISRZ001)"
        END
   WHEN R = '2' THEN
       DO
         ADDRESS ISPEXEC
         "DISPLAY PANEL(CPYILAPN)"
         "SETMSG MSG(ISRZ001)"

         IF (KEY = PF03) THEN
         DO
           EXIT
         END
         ELSE
         DO
           CALL VLD_CPY_DATA
           CALL RTRV_GIB_ILA
         END
       END

   OTHERWISE
       DO
         KEY1 = '   '
         RES =  '   '
         MSG01 = 'PLEASE ENTER CORRECT OPTION'
         "ADDPOP ROW(5) COLUMN(10)"
         "DISPLAY PANEL(MSG001)"
         "REMPOP"
         INVLD_OP = 1
         SAY KEY1
         SAY RES
         IF RES = ENTER THEN
         DO
           "DISPLAY PANEL(MSTRPNL1)"
           "SETMSG MSG(ISRZ001)"
         END
         ELSE
         DO
           EXIT
         END
       END
  END
END


popup ISPF panel

)ATTR                                      
$ TYPE(OUTPUT) INTENS(HIGH) COLOR(GREEN)    
~ TYPE(INPUT) INTENS(HIGH) COLOR(GREEN)    
)BODY WINDOW(35,2)                          
$MSG01                                      
)END                                        
)PROC                                      
&KEY1 = .PFKEY                              
&RES = .RESP                                
)END                  



debug screen

     93 *-*    OTHERWISE                                
     94 *-*     DO                                      
     95 *-*      KEY1 = '   '                            
        >L>        "   "                                
     96 *-*      RES =  '   '                            
        >L>        "   "                                
     97 *-*      MSG01 = 'PLEASE ENTER CORRECT OPTION'  
        >L>        "PLEASE ENTER CORRECT OPTION"        
     98 *-*      "ADDPOP ROW(5) COLUMN(10)"              
        >L>        "ADDPOP ROW(5) COLUMN(10)"            
     99 *-*      "DISPLAY PANEL(MSG001)"                
        >L>        "DISPLAY PANEL(MSG001)"              
 ***                                                    
                                                         
    100 *-*      "REMPOP"        
        >L>        "REMPOP"      
    101 *-*      INVLD_OP = 1    
        >L>        "1"            
    102 *-*      SAY KEY1        
        >V>        "   "          
                                 
    103 *-*      SAY RES          
        >V>        "   "          
                                 
    104 *-*      IF RES = ENTER  
        >V>        "   "          
        >L>        "ENTER"        
        >O>        "0"            
    109 *-*      ELSE            
    110 *-*       DO              
    111 *-*        EXIT          
 ***                                    
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Not getting keystroke values from ISPF popup panel

Postby willy jensen » Sat Jun 16, 2018 8:00 pm

remove the )END statement in line 6
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Not getting keystroke values from ISPF popup panel

Postby nikesh_rai » Sat Jun 16, 2018 8:20 pm

Thanks Willy, code is working fine now after removing )END. :)
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Not getting keystroke values from ISPF popup panel

Postby Pedro » Mon Jun 18, 2018 9:47 pm

I do not think you should check which PF key was pressed because the user can redefine their keys to be something else.

I think the preferred approach is to check the return code for the DISPLAY service for 0 or 8.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Not getting keystroke values from ISPF popup panel

Postby nikesh_rai » Wed Jun 20, 2018 1:10 pm

Thanks Pedro,

I will try this option as well and will let you know. Thanks for this suggestion. :)
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post