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 

Placing cursor in ISPF panel

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


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Thu Nov 27, 2014 6:00 am    Post subject: Placing cursor in ISPF panel Reply with quote

I realise this sounds like a stupid question, but I've taken an example from the IBM manual and it's simply not "behaving" as I would expect. Here's the panel
Code:

)BODY                                                               
%------  NRETRIEV Test Panel ---------------------------%           
%COMMAND%===>_ZCMD                                                 
               +                                                   
+                                                                   
+  Project ===>_PROJECT +                                           
+  Group   ===>_GROUP1  +===>_GROUP2  +===>_GROUP3  +===>_GROUP4  +
+  Type    ===>_TYPE    +                                           
+  Member  ===>_MEMBER  +                                           
+  DS Name ===>_OTHERDSN                                     +     
+  Volume  ===>_VOLUME+                                             
+  Workstation File ===>_WSFILE                               +     
)INIT                                                               
 .NRET = ON                      /* Make NRETRIEV key active  */   
)REINIT                                                             
   REFRESH (*)                                                     
   .NRET = ON                    /* Make NRETRIEV key active  */   
)PROC                                                               
.NRET = OFF          /*IMPORTANT - Make NRETRIEV key inactive */   
&MYCURS = 'WSFILE'                                                 
.CURSOR = &MYCURS                                                   
*REXX(MYCURS)                                                       
  say 'In )PROC, MYCURS = 'MYCURS                                   
*ENDREXX                                                           
)END                                                               


If I run this panel using option 7.2, and press enter, I see that the value in &MYCURS is WSFILE, so I would expect the cursor to be placed in the WSFILE field, but no, it's placed in the project field instead.

I'm not an expert at writing ISPF panels. Generally speaking, I copy a skeleton that does the job approximately and change it as needed.

Any suggestions please
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


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

PostPosted: Thu Nov 27, 2014 11:24 am    Post subject: Reply with quote

In your init section...
Code:
.cursor = wsfile

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Fri Nov 28, 2014 2:53 am    Post subject: Reply with quote

Quote:

and press enter, I see that the value in &MYCURS is WSFILE, so I would expect the cursor to be placed in the WSFILE field


Sorry Nic, as mentioned, it's NOT a case of placing the cursor in the WSFILE field when the panel is shown the first time in, it's placing it there after I've pressed enter.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


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

PostPosted: Fri Nov 28, 2014 10:41 am    Post subject: Reply with quote

Put it in the )REINIT section then
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Dec 01, 2014 5:58 am    Post subject: Reply with quote

Are we talking at x-purposes here ?

If I change the code as you sugested (?) to
Code:

)INIT                   
 .NRET = ON             
)REINIT                 
&MYCURS = 'WSFILE'     
.CURSOR = &MYCURS       
REFRESH (*)             
)PROC                   
&MYCURS = 'WSFILE'     
.CURSOR = &MYCURS       
)END                   


I then test via 7.2, bring up the panel, tab down to the TYPE field, press enter, then the cursor is STILL placed in the project field.

Why isn't it getting placed in the WSFILE field ????
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
arnold57
Beginner


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Wed Dec 03, 2014 5:39 pm    Post subject: Reply with quote

Setting .CURSOR in the )PROC (or )REINIT) section only takes effect if the panel is redisplayed. Dialog test (7.2) does not redisplay the panel when you press enter with no errors. It does another initial display.

Your dialog can cause a redisplay by using the DISPLAY service with no PANEL specified.

Or you can cause a redisplay by forcing an error in the )PROC section (e.g. using a VER or setting .MSG). You must set .CURSOR before the error or the error will set .CURSOR - and once set, you cannot change it. Also, you might want to set .CSRPOS as well, since the error will also set that.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Thu Dec 04, 2014 3:11 am    Post subject: Reply with quote

Thanks Arnold. The following worked as I expected (and you explained)
Code:

)INIT                     
)REINIT                   
REFRESH (*)               
)PROC                     
.CURSOR = 'WSFILE'       
VER(&PROJECT,NONBLANK)   
)END                     


Cursor was placed in project field, I pressed enter, received the message and the cursor was then placed in WSFILE.

(Now to try and remember that NEXT time)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
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