Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 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 |
|
|