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
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