View previous topic :: View next topic
|
Author |
Message |
WilliamDownie
New User
Joined: 01 Jul 2020 Posts: 21 Location: UK
|
|
|
|
I have having a problem using variable model lines. Below is a cutdown version of my panel. The purpose of the panel is to list members. Optionally, when 'descyn' set to 'Y', it will output a row containing a description of the member, and following that a static separator line.
Code: |
)ATTR
# TYPE(TEXT) INTENS(LOW) SKIP(OFF)
_ TYPE(INPUT) INTENS(HIGH) CAPS(ON)
@ TYPE(OUTPUT) INTENS(LOW) COLOR(GREEN)
)BODY EXPAND(//)
Command ===>_ZCMD
+
+ Description ===>_z+
+
+Act Member
+-/-/
)MODEL ROWS(ALL)
&MDL1
&MDL2
&MDL3
)INIT
.ZVARS='(descyn ACT)'
IF (&descyn=' ') &descyn='N'
)PROC
IF (&DESCYN='N')
&MDL1='_Z# @MemLoc '
&MDL2='OMIT'
&MDL3='OMIT'
ELSE
&MDL1='_Z# @MemLoc '
&MDL2=' @MemDsc '
&MDL3='-------------------------------------------------------------'
)END |
When I start the Dialogue (the first panel it displays is this one) it errors saying &MDL1 has not been initialised:
Code: |
ISPP316
, ,
Model line not defined ,
The variable model line has not been initialized before the display.
Panel line where error was detected:
&MDL1 |
Can anyone see what I am doing wrong ? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 724 Location: Denmark
|
|
|
|
You haven't initialized the MDL1 (and supposedly neither MLD2 nor MDL3) before display. What you show in the panel is setting the variables in the PROC section, which runs after the display. You my try setting the variables in the INIT section, though I seem to remember that model lines must be defined prior to the TBDISPL command. |
|
Back to top |
|
|
WilliamDownie
New User
Joined: 01 Jul 2020 Posts: 21 Location: UK
|
|
|
|
Thanks Willy, that was the problem. What I have done is to initialise the variable model lines in my dialogue code, before doing the "DISPLAY PANEL(xxxxxx)". |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2586 Location: Silicon Valley
|
|
|
|
The sections of the panel )BODY, )INIT, and )PROC have to occur in that order in the panel member. But you should think of it that they are executed in this order:
Code: |
1. driving program code
2. )INIT section code
3. )BODY
4. )PROC section code
5. more driving program code
|
|
|
Back to top |
|
|
|