cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Popup box to add variable

Hey,

I Want to save a file but i want to put a variable before my "TrendFile"

dt << save(
Route || "TrendFile-" ||"WW"||
Char( Week Of Year( Today() ) ) || "." || Char( Day ( Today() ) )|| "."|| Char( month ( Today() ) ) || "." ||Char( Year ( Today() ) )||
".txt"
);

So was going to create a popup box

nw = New Window( "Input",
H List Box( Text Box( "Input Tool ID " ), Tool = Text Edit Box() ),
Button Box( "OK",
TooID = Tool << get text;
nw << close window;

)
);

dt << save(
Route || ToolID || "TrendFile-" ||"WW"||
Char( Week Of Year( Today() ) ) || "." || Char( Day ( Today() ) )|| "."|| Char( month ( Today() ) ) || "." ||Char( Year ( Today() ) )||
".txt"
);

would this be right?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Popup box to add variable

You need to use a Modal box for your input, otherwise the processing will not wait for the user input, before trying to Save.

nw = New Window( "Input",
	<<modal,
	H List Box( Text Box( "Input Tool ID " ), Tool = Text Edit Box() ),
	Button Box( "OK", TooID = Tool << get text )
);
If( nw["button"] == -1,
	Throw(),
	dt << save(
		Route || ToolID || "TrendFile-" || "WW" || Char( Week Of Year( Today() ) ) || "."
		 || Char( Day( Today() ) ) || "." || Char( Month( Today() ) ) || "." ||
		Char( Year( Today() ) ) || ".txt"
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Popup box to add variable

You need to use a Modal box for your input, otherwise the processing will not wait for the user input, before trying to Save.

nw = New Window( "Input",
	<<modal,
	H List Box( Text Box( "Input Tool ID " ), Tool = Text Edit Box() ),
	Button Box( "OK", TooID = Tool << get text )
);
If( nw["button"] == -1,
	Throw(),
	dt << save(
		Route || ToolID || "TrendFile-" || "WW" || Char( Week Of Year( Today() ) ) || "."
		 || Char( Day( Today() ) ) || "." || Char( Month( Today() ) ) || "." ||
		Char( Year( Today() ) ) || ".txt"
	)
);
Jim

Recommended Articles