View previous topic :: View next topic
|
Author |
Message |
Ron Masters Currently Banned New User
Joined: 21 Dec 2011 Posts: 24 Location: UK
|
|
|
|
Dear people
I'm long in the tooth on rexx, but a beginner at making ISPF Services dance for me. Here's my rexx fragment...
Code: |
panel = "PANEL(URPNAMLA)"
do until rc >= 8
cmd = "TBDISPL" table panel
address ISPEXEC cmd
|
...and here's my panel...
Code: |
)ATTR
/*********************************************************************/
/* */
/* Aggregate Name List panel */
/* */
/* Amendment Log */
/* ------------- */
/* 19 Jun 2012 RM Original code */
/*********************************************************************/
09 TYPE(FP) /* Field prompt */
26 TYPE(NEF) CAPS(ON) PADC(USER) /* Normal entry field */
# TYPE(OUTPUT) COLOR(WHITE)
[ TYPE(OUTPUT) COLOR(GREEN)
~ TYPE(OUTPUT) COLOR(BLUE)
% TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(WHITE)
+ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(BLUE)
$ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(GREEN)
] TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(TURQ)
_ TYPE(NEF) CAPS(ON)
)BODY CMD(ZCMD) Expand({}) WIDTH(&ZSCREENW)
{ }+User Repository V101 { }
Command ===> ZCMD { } Scroll ===> AMT
$
$
$Aggregate list of Names Filters
$ System :#filsys $Service :#filsvc
$ Userid :#filusr $CEN :#filcen
$
+Primary commands. . :%L
+Line commands . . . :%S
$
%S Count Name
%- ----- {-}
)MODEL
_s$[tblcnt[tblname
)INIT
)PROC
VER (&ZTDSELS,LIST,0000,0001,MSG=URM001B)
VER (&S,LIST,S,MSG=URM001D)
)END
|
...in which msg URM001B is 'Select just one' and msg URM001D is 'Invalid line command'.
The requirement is to prevent control returning from TBDISPL with rc(4).
My panel when displayed is fine. When I type 'S' as a line command into more than one row and hit Enter, these things happen: control is not returned from TBDISPL, I get msg URM001B as expected and the cursor is positioned on the first row selected, and the line commands are still there where I typed them. All this is good.
What I want now is to be able to remove all (or all but one) of my line commands, so that verification in the )PROC section will succeed and control will return from TBDISPL to the rexx.
The problem is that the first VER in the )PROC sention continues to produce msg URM001B and re-display the panel without returning control, setting the cursor to the first row where I had entered a line command, even though I blanked it out.
Please does anyone know how I can write the panel so that TBDISPL will check there is no more than one row which has a non-blank line command, and that that line command is an 'S'?
Thanks
Ron |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Dont check ZTDSELS in )PROC, but in your code. If > 1 display message
and set ZTDSELS = 0 and redisplay your panel. Maybe that will work. |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
Adopt this example:
Code: |
/* REXX - Sample TBDISPL Dialog */
/* I use panel ISPYVPN as it exists in standard ispf libraries. */
address ispexec
'control errors return'
/* Initialize some working variables. */
table = 'sample'
panel = 'ispyvpn'
loop_end = 0
ispyvll = '99'
ispyvls = ''
/* First create the table and load some sample data. */
'tbcreate' table 'names(ispyvvn ispyvpl ispyvat ispyvvl) nowrite'
do i = 1 by 1 to 22
ispyvvn = 'Var#' i
ispyvpl = i
ispyvat = i
ispyvvl = 'Value' random(1,100)
'tbadd' table
end
'tbtop' table
/* Now display the table and start the loop processing. */
do while loop_end = 0
ispyvlc = '' /* Initialize line command field */
'TBDISPL' table 'PANEL(' !! panel !! ')'
if rc > 4 then loop_end = 1 /* User wants to leave the dialog */
else do
select
when ztdsels > 1 then , /* Multiple lines were selected */
do
zedlmsg = 'Please select only ONE line'
'setmsg msg(isrz001)'
end
/* Process valid line command 'S' */
when ((ztdsels = 1) & (ispyvlc = 'S')) then ,
do
zedlmsg = '<S> on variable' ispyvvn 'completed'
'setmsg msg(isrz000)'
end
/* Process valid line command 'Q' */
when ((ztdsels = 1) & (ispyvlc = 'Q')) then ,
do
zedlmsg = '<Q> on variable' ispyvvn 'completed'
'setmsg msg(isrz000)'
end
otherwise NOP /* Reposition the table display */
do /* when user did nothing than ENTER */
'tbtop' table
'tbskip' table 'row(' !! ztdtop !! ')'
end
end
end
end
'tbend' table
exit
|
|
|
Back to top |
|
|
Ron Masters Currently Banned New User
Joined: 21 Dec 2011 Posts: 24 Location: UK
|
|
|
|
Thanks for the quick response, Peter.
I want to avoid returning to the rexx if possible.
Ron |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well what someone wants is not always possible, but maybe you can do it in the )INIT or )REINIT section of the panel. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I want to avoid returning to the rexx if possible. |
If you post why you prefer this, it will help us understand. |
|
Back to top |
|
|
|