Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with TBDISPL

Status
Not open for further replies.

SowKan

Technical User
Mar 18, 2004
24
IN
I am using a command
ISPEXEC TBDISPL MYTAB PANEL(MYPANEL)
IF &ZTDSELS = 0 THEN DO
EXIT CODE(0)
END
IF &ZTDSELS > 0 THEN DO
CONTROL MSG
WRITE MEMBER SELECTED - &MEMBER
CONTROL NOMSG
END
However, when I select multiple rows from the panel, the control does not pass to the &ZTDSELS > 0 para. It works for only if I select one row. Is there anything that needs to be changed?
Please let me know.
Sowmya.
 
This is CLIST, not REXX. It has been too long since I have lost my fluency with CLIST for me to give you a good CLIST answer. The REXX answer, however, looks like this:
Code:
   do forever
      "TBDISPL" $tn$ "PANEL(HLDETL)"
      if rc > 4 then leave          
      do ztdsels
         select
            when action = "D" then ...
            otherwise nop
         end                           /* Select                     */
 
         if ztdsels = 1 then,          /* never do the last one      */
            ztdsels = 0
         else "TBDISPL" $tn$           /* next row                   */
      end                              /* ztdsels                    */
      action = ''                      /* clear for re-display       */
   end                                 /* forever                    */

Notice the "do ztdsels". The loop is executed once for every selected row. Note, also, that except when ztdsels is 1, a TBDISPL without panelname is done; this positions to the next selection.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Rexxhead,
I tried displaying ZTDSELS. When no rows are selected, it is 0. When one row is selected, it is 1. When more 2 or more rows are selected, the program ends without even displaying the value of ZTDSELS. This is what I tried.
DO
ISPEXEC TBDISPL MYTAB PANEL(MYPANEL)
CONTROL MSG
WRITE ZTDSELS - &ZTDSELS
CONTROL NOMSG
IF &LASTCC > 4 THEN GOTO FINI
DO WHILE &ZTDSELS NE 0
CONTROL MSG
WRITE &NAME - &TYPE
CONTROL NOMSG
IF &ZTDSELS = 1 THEN SET &ZTDSELS = 0
ELSE ISPEXEC TBDISPL MYTAB
SET ZTDSELS = &ZTDSELS - 1
END
ISPEXEC TBCLOSE MYTAB
END
 
You need to run this with CONTROL MSG SYMLIST CONLIST and see what it is doing. You also need to have an error-checking block early in the code:
Code:
ERROR DO
   SET RETCD = &LASTCC 
   /* is a RETURN needed here?    I forget...
   END
so that you can interrogate &RETCD after every TBDISPL.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top