cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
uProf
Level III

Open closed file and append

Hi -

 

Is there a way to open closed Journal file and append to it?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
uProf
Level III

Re: Open closed file and append

Appreciate your help, Ih!

 

I modified your script a bit to get the following working in Jmp 12.2 to append in closed journal.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//Save the first journal with a tab box already in it
j1 = New Window( "Journal_1", <<journal, tbox = Tab Box() );
tbox << Append ("1", vlb = Panel Box());
vlb << Append( dt << bivariate( x( :weight ), y( :height ) ) );   
j1 << save journal( "$TEMP\Existing.jrn" );
j1 << close window();

//Open closed journal
nw_existing = Open( "$TEMP\Existing.jrn" );
tb = (nw_existing << XPath("//TabListBox"))[1];
tb << Append("2",vlb2 = Panel Box());
vlb2<< Append( dt << oneway( x( :sex ), y( :height ) ) );

View solution in original post

7 REPLIES 7
txnelson
Super User

Re: Open closed file and append

Here is the method that I used to solve this issue in your previous discussion entry

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

j1 = New Window( "Journal_1",
    <<journal,
    dt << bivariate( x( :weight ), y( :height ) )
);
Current Journal() << save journal( "$TEMP\Existing.jrn" );
Current Journal() << close window();

//Open closed journal
nw_existing = Open( "$TEMP\Existing.jrn" );

//Create New journal
nw2 = New Window( "Journal_2", <<journal, dt << oneway( x( :sex ), y( :height ) ) );
Current Journal() << save journal( "$TEMP\New.jrn" );

//create new window
nw = New Window( "Final",<<journal );

//add older jrn first, followed by recent one
nw << append( nw_existing );
//nw << append( Report(nw_existing)); // does not make any difference
nw << append( nw2 );
Jim
uProf
Level III

Re: Open closed file and append

I took this a step further to append each jrn file as a tab in a consolidated journal file.

 

Shown below is modified code that works in Jmp 14.3.0 but not in Jmp 12.2.0.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

j1 = New Window( "Journal_1",
    <<journal,
    dt << bivariate( x( :weight ), y( :height ) )
);
Current Journal() << save journal( "$TEMP\Existing.jrn" );
Current Journal() << close window();

//Open closed journal
nw_existing = Open( "$TEMP\Existing.jrn" );

//Create New journal
nw2 = New Window( "Journal_2", <<journal, dt << oneway( x( :sex ), y( :height ) ) );
Current Journal() << save journal( "$TEMP\New.jrn" );

//create new window
nw = New Window( "Final", tbox = Tab Box() );

//add New jrn first, followed by Existing
tbox << Append ("New", vlb = Panel Box());
vlb << Append( nw2 );
tbox << Append ("Existing", vlb = Panel Box());
vlb << Append( nw_existing );

 Output from Jmp 12.2.0 included below. New tab is populated but Existing tab does not have the plot.

 

U.png

I am limited to usage of Jmp 12.2.0 so would like to figure out a way to get this working. Appreciate help and pointers.

Thanks!  

ih
Super User (Alumni) ih
Super User (Alumni)

Re: Open closed file and append

Hello @uProf,

 

If you step through your code, running one line at a time, in 12.2, what line does not do what you expect it to?  For example does the the existing journal open and contain everything you expect it to? Doing that bit of troubleshooting will lead you to a more specific question and get you to a solution faster.

uProf
Level III

Re: Open closed file and append

Hello Ih-

Last line of code is not working as expected in Jmp 12.

There is no error message in the log either when last line is executed.
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Open closed file and append

I no longer have JMP 12 so I can't test anything here.  Can you append other things to the new tab, like the oneway report itself, instead of trying to append another journal?  If so you might be able to do something like this:

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//Save the first journal with a tab box already in it
j1 = New Window( "Journal_1", <<journal, tbox = Tab Box() );
tbox << Append ("1", vlb = Panel Box());
vlb << Append( dt << bivariate( x( :weight ), y( :height ) ) );   
j1 << save journal( "$TEMP\Existing.jrn" );
j1 << close window();

//Open closed journal
nw_existing = Open( "$TEMP\Existing.jrn" );

//Find tab list box
tbox = (nw_existing << XPath("//TabListBox"))[1];

//get tab names
Tabs = (nw_existing << XPath("//TabPageBox"));

//get next name
newTabNum = num(Tabs[n Items(Tabs)] << Get Title) + 1;

//Add a tab
tbox << Append (char(newTabNum), vlb = Panel Box());

//Add content to tab
vlb<< Append( dt << oneway( x( :sex ), y( :height ) ) );
txnelson
Super User

Re: Open closed file and append

Early versions of JMP that had panel boxes and tab boxes had issues with them.  I have tried several old tricks to try to get the code to work, but have failed to resolve the issue.  Sorry.

Jim
uProf
Level III

Re: Open closed file and append

Appreciate your help, Ih!

 

I modified your script a bit to get the following working in Jmp 12.2 to append in closed journal.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//Save the first journal with a tab box already in it
j1 = New Window( "Journal_1", <<journal, tbox = Tab Box() );
tbox << Append ("1", vlb = Panel Box());
vlb << Append( dt << bivariate( x( :weight ), y( :height ) ) );   
j1 << save journal( "$TEMP\Existing.jrn" );
j1 << close window();

//Open closed journal
nw_existing = Open( "$TEMP\Existing.jrn" );
tb = (nw_existing << XPath("//TabListBox"))[1];
tb << Append("2",vlb2 = Panel Box());
vlb2<< Append( dt << oneway( x( :sex ), y( :height ) ) );