Some problems using a panel



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Some problems using a panel

Postby shichumike » Wed Sep 16, 2009 7:52 am

Recently I am working on REXX and ISPF DIALOG and encountered some problems, thanks for your help!

Here is the sample code I wrote:

Do Forever                           
  "DISPLAY PANEL(panel1)"   /* panel*  are the panels to be displayed */     
                           
  if rc = 0 then do               
    fvar= VALUE(C)       /* C is a variable from the panel panel1*/             
    SELECT                           
       WHEN  strip(fvar) = 1 then do 
             RC = CP0100()            /* CP0x00 are the functions to be called */
       END
       WHEN  strip(fvar) = 2 then do 
             RC = CP0200()         
       END                                                                           
       END
       WHEN  strip(fvar) = 3 then do 
             exit 0         
       END                                   
       OTHERWISE                     
             SAY 'Wrong!'             
             exit 0                   
       END                           
    END                               
  end
 exit 0

CP0100:                /* This is the function cp0100 */   
  "DISPLAY PANEL(panel2)"
return 0     

CP0200:                /* This is the function cp0200 */   
  "DISPLAY PANEL(panel3)"
return 0   


Here is what panel1 is like:


Please select one of the following, then press ENTER

_ 1. Call cp0100
2. Call cp0200
3. EXIT

This code worked, but there are some problems.

1.I used a "DO FOREVER" statement for a infinite loop, but when i am in the panel "cp0000p", the only way to end this loop(quit this dialog) is enter '3' and exit it.
It seems that PF3 key can not end this loop, I think that's not good. How to solve this problem?

2.For example, in panel1 i filled in the input field '1' then press enter, the program call cp0100 and displays panel2. Then I press PF3, the programe go back to display panel1. What I hope is that the iuput field in panel1 should be blank. But the fact is that it still has '1' in it.
So the problem is the input field can not be refreshed when a panel is redisplayed.
I tried REFRESH(*) in the panel design, but it still doesn't work....How to solve this problem?

Thanks!!
shichumike
 
Posts: 2
Joined: Wed Sep 16, 2009 7:25 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some problems using a panel

 

Re: Some problems using a panel

Postby expat » Wed Sep 16, 2009 2:45 pm

It is the REXX varaiable that will retain the value, you need to reset that.
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Some problems using a panel

Postby shichumike » Fri Sep 18, 2009 12:44 pm

It's working!! Thanks very much!
shichumike
 
Posts: 2
Joined: Wed Sep 16, 2009 7:25 am
Has thanked: 0 time
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post