View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 616 Topics: 171 Location: Stockholm, Sweden
|
Posted: Thu Nov 27, 2014 6:00 am Post subject: Placing cursor in ISPF panel |
|
|
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 |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Nov 27, 2014 11:24 am Post subject: |
|
|
In your init section...
_________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 616 Topics: 171 Location: Stockholm, Sweden
|
Posted: Fri Nov 28, 2014 2:53 am Post subject: |
|
|
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 |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Nov 28, 2014 10:41 am Post subject: |
|
|
Put it in the )REINIT section then _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 616 Topics: 171 Location: Stockholm, Sweden
|
Posted: Mon Dec 01, 2014 5:58 am Post subject: |
|
|
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 |
|
|
arnold57 Beginner
Joined: 01 Oct 2004 Posts: 30 Topics: 0
|
Posted: Wed Dec 03, 2014 5:39 pm Post subject: |
|
|
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 |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 616 Topics: 171 Location: Stockholm, Sweden
|
Posted: Thu Dec 04, 2014 3:11 am Post subject: |
|
|
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 |
|
|
|
|