Learning to work with Lists
Hello friends,
I am new scripting with list, but I know the powerful they have.
I would like to take profit of that, but I need your help.
I try to do several identical graphs. The only think it changes is the variables to graph.
I create a list with the names of the variables I would like to display in one graph, a I try to use the list to make an easy change script. I only replace the column names by the elements of the list, but I think that perhaps there is another way to simplify my scripting.
Here is my scripting I would like to reduce using the power of list:
Can anyone help me?
VARS={"P04_02", "P04_05", "P04_06", "P04_04"};
gb=New Window("Grafico-02",
Graph Builder(
Size( 569, 500 ),
Show Control Panel( 0 ),
Variables(
X( :año ),
Y( Column(VARS[1]), Size( 0, 17 ) ),
Y( Column(VARS[2]), Position( 1 ), Size( 0, 17 ) ),
Y( Column(VARS[3]), Position( 1 ), Size( 0, 17 ) ),
Y( Column(VARS[4]), Position( 1 ), Size( 0, 17 ) )
),
Elements(
Line(
X,
Y( 1 ),
Y( 2 ),
Y( 3 ),
Y( 4 ),
Legend( 3 ),
Row order( 0 ),
Summary Statistic( "Mean" )
)
),
SendToReport(
Dispatch(
{},
VARS[1],
ScaleBox,
{Format( "Best", 10 ), Add Ref Line( 9, Dotted, "Black" ),
Add Ref Line( 8, Dotted, "Black" ), Add Ref Line( 7, Dotted, "Black" )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Level Name( 0, char(column(VARS[1])< Level Name( 1, char(column(VARS[2])< Level Name( 2, char(column(VARS[3])< Level Name( 3, char(column(VARS[4])< Properties( 0, {Fill Color( 1 )} ),
Properties( 1, {Fill Color( 2 )} ),
Properties( 2, {Fill Color( 3 )} ),
Properties( 3, {Fill Color( 4 )} )
)}
),
Dispatch( {}, "400", LegendBox, {Set Title( "Item evaluat:" )} )
)
)
);
Message was edited by: Teresa