)ATTR DEFAULT(%+_)
% TYPE(TEXT) INTENS(HIGH) COLOR(WHITE)
! TYPE(TEXT) COLOR(BLUE)
+ TYPE(TEXT) INTENS(LOW) COLOR(BLUE)
_ TYPE(NEF) CAPS(ON) JUST(LEFT)
)BODY WINDOW(55,5)
!
! Load/Unload (L/U) %===>_Z+
! The following 2 options are only relevant for Load
! Offset %===>_OFF
! Append/Replace (A/R) %===>_Z+
)INIT
.ZVARS = '(LOADUNL,APPREPL)'
&ZSAVTTL = &ZWINTTL
&ZWINTTL = 'DSNUTILB options'
VGET (LOADUNL,APPREPL,OFFSET) PROFILE
&OFF = &OFFSET
)REINIT
)PROC
&ZWINTTL = &ZSAVTTL
&ZSEL = ''
&OFFSET = &OFF
VER(&LOADUNL,NONBLANK,LIST,L,U) /* Only L or U */
VER(&APPREPL,LIST,A,R,) /* Only A or R */
IF (&LOADUNL = U)
IF (&OFF NE '')
/* They chose U AND filled in offset, not allowed */
.CURSOR = OFF
.MSG = SQL005
IF (&APPREPL NE '')
/* They chose U AND filled in append/replace, not allowed */
.CURSOR = APPREPL
.MSG = SQL005
IF (&LOADUNL = L)
/* Selected L, ensure Offset and Append/Replace filled in */
VER(&OFF,NONBLANK,RANGE,1,100) /* Only between 1 & 100 */
VER(&APPREPL,NONBLANK,LIST,A,R,) /* Only A or R */
&OFFSET = &OFF
&MSPFKEY = 'PF00'
&MYCURS = .CURSOR
/* An explanation is required */
/* On the main panel, they chose the DSNUTILB option which */
/* automatically brings them to this panel. */
/* When they press PF3 here, they're taken back to the */
/* original panel, but the value in MYCURS is still set to */
/* SQLOPT. This in turn means that they need to press enter */
/* TWICE to actually get the work done. To avoid this, */
/* we deliberately set MYCURS to the current cursor */
VPUT (LOADUNL,OFFSET,APPREPL,MYCURS,MSPFKEY) PROFILE
)END
and the actual code to drive the panel itself is defined as
My problem is as follows.
The main panel with all the pull-down options saves the last pull-down option the user chose. When the user reenters the panel, if they simply press enter, then the previous option is run again. For example, start the panel, select the SQL INSERT option and the code is generated. Now exit the panel, start it again and the default generated SQL code if I press enter will be INSERT again (on the basis that I didn't select/change the previous pull-down option used).
Now to my problem.
I select option 22 above and am presented with the MSSQLDDL panel defined above. I enter my values and DSNUTIL JCL is generated.
I now exit the main panel, and restart it.
By default, option 22 is the default option.
However, if I now press Enter, the MSSQLDDL is never shown, so I never have any chance to change from, say, Unload to Load or vice-versa.
Is there some simple parameter I'm missing that forces the panel to be shown? _________________ Michael
Joined: 02 Dec 2002 Posts: 624 Topics: 175 Location: Stockholm, Sweden
Posted: Wed Dec 28, 2022 8:46 am Post subject:
Okay, here's how I solved it (probably clunky, but if someone has a better idea, then I'd be happy to hear it).
The basic problem is the action bar (AB) only runs the commands associated with the AB option if the user actually opens the relevant AB.
For example, say option 22 for the AB is set to
)PROC
&PANELSH = 1 <----- indicate we have shown this panel
VPUT (PANELSH) PROFILE <-----
Now, in the main Rexx script that drives everything, I included
Code:
address ispexec 'VGET (PANELSH) PROFILE'
after main panel display, then the following code that analyzes what the user after pressing Enter/PF3
Code:
when sqlopt = 22 & panelsh = 0 then
do
/* Basically, the ORIGINAL option chosen was 22.
However, this was from the previous time they ran MSGESQL
and NOT this time.
To that end, we want to ensure they are shown the
MSSQLDDL panel again so they CAN change their choices */
rc = MSSQLDDL()
if rc = 8 then
do
/* They pressed PF3 */
curfld = 'SYST' ; csrpos = 1
zverb = 'RESHOW'
end
else
do
rc = process_enter_pressed() <---- business as usual
end
end
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