cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

placeholder for the last returned value

In Mathematica, one can use "%" as a placeholder for the last returned value.

hogi_0-1668342422218.png

 

Is there something similar in JMP?

Then one could use the fact that a reference to an object is returned by the function which creates the object.

Could help during debugging:

Run single lines of the original code, add some test code and get a quick reference to a created object via the placeholder.

 

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Graph Builder(
	Size( 437, 413 ),
	Graph Spacing( 4 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
// during debugging:
gb = %;(gb << XPath( "//AxisBox" )) << select;

// or even better: gb << get XML(); New Window("xml", %)

 

3 REPLIES 3
Craige_Hales
Super User

Re: placeholder for the last returned value

No, there is no way to retrieve the value. You could move the "gb =" to just before the "dt<<GraphBuilder" to capture it.

 

Craige
hogi
Level XIII

Re: placeholder for the last returned value

I posted a wish :
https://community.jmp.com/t5/JMP-Wish-List/JSL-debugging-placeholder-for-last-returned-value/idi-p/5...

and added another example in the code above.

 

Let's see if other users are also interested ...

sure: If you had this comfort in Mathematica, you kind of miss it in JMP.
Could be that you don't miss it if you didn't have it :)

 

pauldeen
Level VI

Re: placeholder for the last returned value

Interesting idea, I kudo'd your wish list item.

I usually work around the absence of this by nesting more things into each other...but it can become difficult to read:

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
	Size( 437, 413 ),
	Graph Spacing( 4 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
CapturedXML = gb << XPath( "//AxisBox" )[1] << get xml; //Like so

Recommended Articles