cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
matteo_patelmo
Level IV

JSL: <

Hello,

 

I would like to use the <<add context function for an outline box as reported in the scripting index.  The purpose is to add information to be used by "make combined data table"

 

w=new window("my window", ob=outline box("my outline"));

ob<<add context (...???);

The description in the scripting index does not explain how to pass the "key-value" pair mentioned.  I tried different options but with no result.  

 

matteo_patelmo_0-1741010168523.png

Can anyone help?

 

thanks
Matteo

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: JSL: <

I assume it is used for something like this

Names Default To Here(1);

nw = New Window("Example",
	ob1 = Outline Box("Outline Box",
		tb1 = table box(string col box("A", {"A", "B", "C"})),
	),
	ob2 = Outline Box("Outline Box",
		table box(string col box("A", {"D", "E", "F"})),
	)
);

ob1 << Add Context("Context", "First OB");
ob2 << Add Context("Context", "Second OB");

tb1 << Make Combined Data Table;

jthi_0-1741017997051.png

 

-Jarmo

View solution in original post

Re: JSL: <

Hi @matteo_patelmo ,

 

I had a mess around with the function, seems its used to create a column and rows into the make combined data table. You could use this to bring in current user generating the report (tracking it with a function) or date or report creation (as some ideas)

 

w=new window("my window", ob=outline box("my outline", Table Box(
			String Col Box( "names",
				{"x", "y", "z"}
			),
			Number Col Box( "values",
				{11, 22, 33}
			),
			Plot Col Box( "values",
				{11, 22, 33}
			)
		)));


ob<<add context("Source", "Study 1");
ob<<add context("Created by", "Ben");

//Hit 'make combined data table' to have these brought in as column headers

Thanks,

Ben

“All models are wrong, but some are useful”

View solution in original post

7 REPLIES 7
txnelson
Super User

Re: JSL: <

I am not familiar with this option, but here is what I found for documentation from JMP version 16

txnelson_0-1741010719501.png

 

Jim
matteo_patelmo
Level IV

Re: JSL: <

Thanks @txnelson for your support, unfortunately this will not address my need.  Let's see if someone else has suggestions

 

Matteo

Re: JSL: <

Hi @matteo_patelmo ,

 

I had a mess around with the function, seems its used to create a column and rows into the make combined data table. You could use this to bring in current user generating the report (tracking it with a function) or date or report creation (as some ideas)

 

w=new window("my window", ob=outline box("my outline", Table Box(
			String Col Box( "names",
				{"x", "y", "z"}
			),
			Number Col Box( "values",
				{11, 22, 33}
			),
			Plot Col Box( "values",
				{11, 22, 33}
			)
		)));


ob<<add context("Source", "Study 1");
ob<<add context("Created by", "Ben");

//Hit 'make combined data table' to have these brought in as column headers

Thanks,

Ben

“All models are wrong, but some are useful”
matteo_patelmo
Level IV

Re: JSL: <

Thanks, this is what I was looking for.

 

Matteo

jthi
Super User

Re: JSL: <

I assume it is used for something like this

Names Default To Here(1);

nw = New Window("Example",
	ob1 = Outline Box("Outline Box",
		tb1 = table box(string col box("A", {"A", "B", "C"})),
	),
	ob2 = Outline Box("Outline Box",
		table box(string col box("A", {"D", "E", "F"})),
	)
);

ob1 << Add Context("Context", "First OB");
ob2 << Add Context("Context", "Second OB");

tb1 << Make Combined Data Table;

jthi_0-1741017997051.png

 

-Jarmo
matteo_patelmo
Level IV

Re: JSL: <

Thanks, this is what I need it for.

 

Matteo

MathStatChem
Level VII

Re: JSL: <

Just wanted to say that this was a great find, I did not know about the <<Add Context() message you could send to a display box.  It solved a problem for me right way, making one of my scripts much easier and more efficient.  Great example of the knowledge sharing that happens on the Community.

 

It would be nice if this was better documented.  For instance, I think I have discovered that the context pairs have to be strings, e.g.

 

// this works
box << Add Context("a", "2")
// this does not work
box << Add Context("a", 2)

Recommended Articles