View previous topic :: View next topic
|
Author |
Message |
samedesh Currently Banned New User
Joined: 22 May 2007 Posts: 46 Location: India
|
|
|
|
Hi,
I have three panels say A and B and C. All are selection panels. B and C panels are called from panel A by ZSEL command. B and C panels both call same rexx program say REXXPROG.
Panel A:
Code: |
)ATTR DEFAULT(%+_)
$ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(GREEN)
! TYPE(INPUT) INTENS(LOW) PAD(_) color(white)
)BODY Expand(\\)
+-\-\- Code Generator -\-\-
+
%OPTIONS ===>!opt
+
+
+ Select below options to continue..
+ %1.$ Call Panel B.
+
+ %2.$ Call Panel C.
)PROC
&ZSEL=TRANS(TRUNC(&opt,'.')
1,'panel(B)'
2,'panel(C)'
' ',' '
*,'?')
)END |
Panel B :
Code: |
)ATTR DEFAULT(%+_)
)BODY
%------------------ TITLE FOR MENU SELECTION PANEL -----------
%SELECTION ===>_ZCMD
+
+ THIS DIRECTION LINE TELLS THE USER HOW TO USE THE PANEL:
+ Enter below details:
+ Enter dataset name: _V1
+ %1+ Call Code REXXPROG
%2+ Call Dummy rexx
)PROC
&ZSEL=TRANS(TRUNC(&ZCMD,'.')
1,'CMD(REXXPROG)'
2,'CMD(PANEL1)'
' ',' '
*,'?')
)END |
Panel C is somewhat same as panel B.
Rexx Code:
Code: |
/* rexx */
if opt=2
say 'You are correct'
else
say 'Option incorrect' |
My query is: I am not getting value opt = 2 in rexx program when I am selecting option 2 in panel A. Can any one please help me? I am getting value of opt as OPT. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And where do you enter 2 as an option ? |
|
Back to top |
|
|
samedesh Currently Banned New User
Joined: 22 May 2007 Posts: 46 Location: India
|
|
|
|
Expat,
in Panel A |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
then... no way to get it in a rexx invoked by panel B
but why, please tell us, You keep mixing selection panels with data entry panels?
after being advised against it
do You realize that You are making life harder for everybody |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Unless the panels are all displayed from within the same REXX code, which in this case I think not, then you will need to store the variable using VPUT from some code in the PROC section, and then retrieve the value in the next called panel. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Yup that' s right expat,
but I was adamant to suggest advanced techniques to somebody who , IMHO, still needs to grasp the basics |
|
Back to top |
|
|
samedesh Currently Banned New User
Joined: 22 May 2007 Posts: 46 Location: India
|
|
|
|
Thanks expat for your valuable suggestion. I will surely try and let you know.
Thanks once again. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
enrico-sorichetti wrote: |
but why, please tell us, You keep mixing selection panels with data entry panels?
after being advised against it
do You realize that You are making life harder for everybody |
A sentiment I agree with 110%.
I always build my panels to all be called and controlled from within one REXX EXEC. That way it is clear what is happening and simpler to maintain or debug.
I guess Enrico and I and numerous others have been where you are now and know from bitter experience the easiest and cleanest way to do these things. |
|
Back to top |
|
|
|