View previous topic :: :: View next topic
Author
Message
Appu New User Joined: 26 Apr 2010Posts: 74 Location: India
Hi Team,
I was trying the dynamic variable in a panel.
Panel Definition:
Code:
@ AREA(DYNAMIC) SCROLL(ON) EXTEND(ON)
* TYPE(INPUT) COLOR(RED) INTENS(LOW) CAPS(ON) HILITE(USCORE)
" TYPE(TEXT) COLOR(GREEN) INTENS(LOW) SKIP(ON)
...
@DYNVAR @
In REXX code I want three input fields as follows :
Code:
DYNVAR = '" "SEGMENT FLD2 :*Z "OP:"*Z"VALUE:"*Z ""'
But in the screen the characters in used in the panel got displayed as such and I didnt get any input fields.
Output :
Code:
" "SEGMENT FLD2 :*Z "OP:"*Z"VALUE:"*Z ""
Please advise.
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8657 Location: Back in jolly old England
PLease explain exactly what it is that you want to do - in detail
Back to top
Appu New User Joined: 26 Apr 2010Posts: 74 Location: India
I want multiple lines of the above values like
SEGMENT FLD1 : ......... OP: ..... Value : .....................
SEGMENT FLD2 : ......... OP: ..... Value : .....................
SEGMENT FLD3 : ......... OP: ..... Value : .....................
SEGMENT FLD4 : ......... OP: ..... Value : .....................
The no. of rows I want can be known at run time only.
So expecting suggestions on why the dynamic var value is not shown as expected eventhough i assigned it.
Back to top
Appu New User Joined: 26 Apr 2010Posts: 74 Location: India
Back to top
Pedro Senior Member Joined: 01 Sep 2006Posts: 2104 Location: Silicon Valley
Quote:
The problem is that you have not read the manuals
I think that for the case of dynamic areas, that it is possible to read the manuals and still not understand how to use them effectively.
You need to read about 'shadow variables'. The dynamic area can be specified by two variables. The first variable is the text to be shown (see dyntext in example). The second variable has the attributes for the text (see dynshad in example). The tricky part is that the first variable can also have attribute characters. Actually, it is all kind of tricky.
Below is my example. When you modify the top section of the panel and press Enter, the dynamic area will change. I like this example because the input area is in turquoise but when you type into it, the color changes to yellow in a similar fashion to how the ISPF editor works.
the panel:
Code:
)ATTR
_ TYPE(INPUT) HILITE(USCORE) COLOR(TURQ) CAPS(OFF)
@ TYPE(INPUT) HILITE(USCORE) COLOR(TURQ)
` AREA(DYNAMIC) EXTEND(ON) SCROLL(ON)
$ TYPE(DATAIN) HILITE(&IHILITE) COLOR(YELLOW)
~ TYPE(CHAR) HILITE(&IHILITE) COLOR(&ICOLOR)
¬ TYPE(DATAOUT) HILITE(&PHILITE) COLOR(&PCOLOR)
# TYPE(DATAOUT) COLOR(&PCOLOR)
+ TYPE(TEXT) COLOR(GREEN)
! TYPE(TEXT) COLOR(BLUE)
} TYPE(OUTPUT) COLOR(TURQ) CAPS(OFF)
)BODY EXPAND(//)
/ /Dynamic Variable Example / /
+Command ===>_ZCMD +
+Field prompt . ._PTEXT +
+Description . . ._PDESC +
+Prompt color. . .@pcolor +(red,white,green,blue,turq,yellow,pink)
+Prompt hilite . .@philite +(uscore,reverse,blink,'blank')
+Input color . . .@icolor +(red,white,green,blue,turq,yellow,pink)
+Input hilite. . .@ihilite +(uscore,reverse,blink,'blank')
+Input length. . .@ilength +(numeric)
!
*- Dynamic Area -----------------------------------------------------*
`DYNTEXT,DYNSHAD `
!
*- Previous value of dynamic area input field: ----------------------*
|}OLDVAR !|
*--------------------------------------------------------------------*
)PROC
VER(&PCOLOR,NB,LIST,RED,BLUE,GREEN,WHITE,TURQ,YELLOW,PINK)
VER(&PHILITE,LIST,USCORE,REVERSE,BLINK)
VER(&ICOLOR,NB,LIST,RED,BLUE,GREEN,WHITE,TURQ,YELLOW,PINK)
VER(&IHILITE,LIST,USCORE,REVERSE,BLINK)
VER(&ILENGTH,NB,NUM)
)END
The rexx program:
Code:
/* rexx */
/* attribute characters from panel definition: */
/* ¬ TYPE(DATAOUT) HILITE(&a) COLOR(&b) - input field prompt */
/* ~ TYPE(CHAR) HILITE(&c) COLOR(&d) - turquoise input */
/* $ TYPE(DATAIN) HILITE(&c) COLOR(YELLOW) - overtype input */
pcolor = "green"
philite = " "
icolor = "turq"
ihilite = "uscore"
ptext = "Please enter your DSN"
pdesc = "(fully qualified)"
dots = ". . ."
ilength = 10
olength = ilength
oldvar = copies(' ',olength)
Address ISPEXEC
rc = 0
Do While rc = 0
/* fill in the dynamic area */
ptext = strip(ptext,"T") /* strip trailing blanks */
/* '¬' indicates the start of output text */
/* '$' indicates the start of the input field */
dyntext = "¬" ptext dots"$" /* build prompt area */
plen = Length(dyntext) /* save Length of prompt */
dyntext = dyntext || left(oldvar,olength) || '¬' ||pdesc||'#'
dynshad = copies(' ',plen) || copies('~',olength)
"DISPLAY PANEL(DYNAMIC9)"
/* get the data that is in the input field */
oldvar = substr(dyntext,plen+1) /* ingore prompt field */
oldvar = substr(oldvar,1,olength) /* save last dyn area input */
olength = ilength
End
Back to top
Please enable JavaScript!