cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

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