The World Statistics Day celebration continues here in the Community. We all need reliable data for sound decision making. Do you have a data source that you trust most? Head over to Discussions to tell us about it.
Choose Language Hide Translation Bar
Level III

## creating a journal in a new window with hlist and vlist boxes with a for loop

Hi. I would like to create a script that creates a new journal with a variable amount of oneway graphs arranged in the way I want.  I have tried multipe ways and cannot figure it out.  Can someone help me?  Thanks!

Trying to write something like this:

Hlist_MSG1 = "HList Box(( oneway_List[";
Hlist_MSG2 = "] << Report) << Clone Box, ( noz_stat[";
Hlist_MSG3 = "] <<Report)[";
Hlist_MSG4 = "] << Clone Box)";

nw = New Window(name, <<Journal,

vlb = V List Box(

for(i=1, i<=n_Copies, i++,

evallist({Hlist_MSG1,
i;
Hlist_MSG2;
i;
Hlist_MSG3;
1;
Hlist_MSG4;

if(i<n_Copies,", ", " ")}));

));

Or like this:

HLIST_MSG_LST[i] = "HList Box(( oneway_List[" || char(i) || "] << Report) << Clone Box, ( noz_stat[" || char(i) || "] <<Report)[1] << Clone Box)");

subs_list = {};

for(i=1, i<=n_Copies, i++, subs_list [i] = "num("||char(i)||")");

num_list = {};

for(i=1, i<=n_Copies, i++, num_list [i] = i);

nw = New Window(name, <<Journal,

vlb = V List Box(

for(i=1, i<=n_Copies, i++,
eval(parse(substitute(HLIST_MSG_LST[i],subs_list[i],num_list[i])));

if(i<n_Copies,", ", " "));

));

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: creating a journal in a new window with hlist and vlist boxes with a for loop

Here is a methodology that I have found to be much easier to build outputs with.  I believe it goes after what you are trying to do, but it is simplert to work with, and easier to follow.

``````Names Default To Here( 1 );
dt = Open( "\$SAMPLE_DATA\Semiconductor Capability.jmp" );

// Create some structures to hold the results
mainBox = V List Box();
theHBox = H List Box();

// Get the column names for the analysis
colList = dt << Get Column Names( continuous );

// Loop across the columns and generate the analyis, placing
// 4 analyses into an H List Box(), and then when all 4 are
// in the H List Box(), add it to the main V List Box();
For( i = 1, i <= 25, i++,
theHBox << Append( oneway( y( colList[i] ), x( :Site ) ) );
If( Mod( i, 4 ) == 0 | i == 25,
mainBox << Append( theHBox );
theHBox = H List Box();
);
);

// Now create the journal to hold all of the results
nw = New Window( "Results", <<journal, finalBox = H List Box() );

// Add the accumulated analyses to the journal
finalBox << Append( mainBox );``````
Jim
3 REPLIES 3
Highlighted
Super User

## Re: creating a journal in a new window with hlist and vlist boxes with a for loop

Here is a methodology that I have found to be much easier to build outputs with.  I believe it goes after what you are trying to do, but it is simplert to work with, and easier to follow.

``````Names Default To Here( 1 );
dt = Open( "\$SAMPLE_DATA\Semiconductor Capability.jmp" );

// Create some structures to hold the results
mainBox = V List Box();
theHBox = H List Box();

// Get the column names for the analysis
colList = dt << Get Column Names( continuous );

// Loop across the columns and generate the analyis, placing
// 4 analyses into an H List Box(), and then when all 4 are
// in the H List Box(), add it to the main V List Box();
For( i = 1, i <= 25, i++,
theHBox << Append( oneway( y( colList[i] ), x( :Site ) ) );
If( Mod( i, 4 ) == 0 | i == 25,
mainBox << Append( theHBox );
theHBox = H List Box();
);
);

// Now create the journal to hold all of the results
nw = New Window( "Results", <<journal, finalBox = H List Box() );

// Add the accumulated analyses to the journal
finalBox << Append( mainBox );``````
Jim
Highlighted
Level III

## Re: creating a journal in a new window with hlist and vlist boxes with a for loop

Thanks Jim,  I won't be able to try and implement this until next week, so I will update then.  But this looks like it should help me.

Highlighted
Level III

## Re: creating a journal in a new window with hlist and vlist boxes with a for loop

never mind, it was easy to implement, so I don't need to wait until next week to see if it works.

It works.

Thank you!!

Article Labels

There are no labels assigned to this post.