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 

TBDISPL

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


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Thu May 12, 2005 2:50 pm    Post subject: TBDISPL Reply with quote

I display a table on a panel:

Code:

COMMAND ==>

     Person
     ----------
1    Tom
2    John
3    Jane
4    Amy
5    Carl

To select a row, user can either type in the number 1 to 5 in the COMMAND field or move the cursor to the row and press ENTER. I can get the selected row if I move the cursor to the row, alter the row number and press ENTER. For example, move cursor to line 2, change 2 to 'X', then press ENTER (Currow is set to 2 in the REXX program). If I move the cursor to row 2 and press ENTER (Currrow is set to 0). How can I get the selected row number without overtyping the row number?

Code:


)PANEL
)ATTR DEFAULT(%+_)
  ! TYPE(OUTPUT) INTENS(HIGH) PAD(' ') JUST(ASIS) COLOR(TURQ)
)BODY
%COMMAND ==>_ZCMD
#
+     Person
+     ----------
)MODEL
_Row !Fname
)INIT
 &ZCMD = ''
 &ZTDMARK=' '
)REINIT
 &ZTDMARK=' '
)PROC
  &COMMAND = ' '
)END


/* REXX */
address ISPEXEC
Names = 'Tom John Jane Amy Carl'
"TBCREATE MYLIST KEYS(ROW) NAMES(FNAME) NOWRITE REPLACE"
Rows = words(Names)
Do Row = 1 to Rows
  FName = word(Names,Row)
  "TBADD MYLIST MULT(5)"
End  /* Do Row =  1 to 5 */

Cancel = 0
"TBTOP MYLIST"
Do until Cancel
  "TBDISPL MYLIST PANEL(LIST) POSITION(CURROW)"
  If rc = 8 then Cancel = 1
  Else do
    say 'ZCmd =' ZCmd
    say 'Currow =' Currow
  End   /* Else do */
End   /* Do until Cancel */
Exit
[/code]
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu May 12, 2005 3:13 pm    Post subject: Re: TBDISPL Reply with quote

How about adding this line:
Code:

/* REXX */
...
"TBTOP MYLIST"
Do until Cancel
  "TBDISPL MYLIST PANEL(LIST) POSITION(CURROW)"
  If rc = 8 then Cancel = 1
  Else do

    ==> If ZCmd <> '' Then "TBSKIP MYLIST ROW("ZCMD") POSITION CURROW)"

    say 'ZCmd =' ZCmd
    say 'Currow =' Currow
  End   /* Else do */
End   /* Do until Cancel */
Exit
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Fri May 13, 2005 7:59 am    Post subject: Reply with quote

Superk,

Your suggestion will not work the way I want. The selected row is determinated in this order:

1. Row number entered in the Command field
2. If Command field is blank, pick the row where is cursor is positioned.

Your statement
If ZCmd <> '' Then "TBSKIP MYLIST ROW("ZCMD") POSITION(CUROW)"
will never be executed since the Command field is blank (see 2 above).
Back to top
View user's profile Send private message
arnold57
Beginner


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Wed Jun 01, 2005 4:56 pm    Post subject: Reply with quote

In the )PROC section add:

IF (&ZCMD = &Z) &ZCMD = .CSRROW
Back to top
View user's profile Send private message
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