cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
Choose Language Hide Translation Bar
UserID16644
Level V

N Col using textbox value

Hi all,

I am trying to create a user input box that will determine the N Col for my line up box. I tried this script 

User_Input = New Window( "N Col", << modal(),
	hlistbox(
		Text Box( "Enter Column No:  " ),
		Col_Num_teb = Text Edit Box( "", <<set width( 200 ) ),
	),
	Button Box( "OK", 
		col_num = col_num_teb << get();
	),
);

lb = LineUpBox( N Col(col_num) );

I tried entering 4 but ends up having 2 columns. How can I correctly get the N Col for my line up box?

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: N Col using textbox value

You could either use Number Edit Box and then << Get or with Text Edit Box use << Get Text and then convert that to number with Num()

 

Names Default To Here(1);

//Text Edit Box
User_Input = New Window("N Col",
	<<modal(),
	H List Box(Text Box("Enter Column No:  "), Col_Num_teb = Text Edit Box("", <<set width(200)), ),
	Button Box("OK", col_num = col_num_teb << get text),
);
show(Num(col_num));

//number edit box
User_Input = New Window("N Col",
	<<modal(),
	H List Box(Text Box("Enter Column No:  "), neb = Number Edit Box(., <<set width(50)), ),
	Button Box("OK", col_num = neb << get),
);
show(col_num);
-Jarmo

View solution in original post

Thierry_S
Super User

Re: N Col using textbox value

Hi,

Unless you convert your text/string into a number, the LineUpBox call will not work. Try replacing the Text Edit Box () with a Number Edit Box

User_Input = New Window( "N Col", << modal(),
	hlistbox(
		Text Box( "Enter Column No:  " ),
		Col_Num_neb = Number Edit Box ( 1 ), // You can replace "1" by any other initial value
	),
	Button Box( "OK", 
		col_num = col_num_neb << get; // You don't need the parentheses here
	),
);

lb = LineUpBox( N Col(col_num) );
Thierry R. Sornasse

View solution in original post

2 REPLIES 2
jthi
Super User

Re: N Col using textbox value

You could either use Number Edit Box and then << Get or with Text Edit Box use << Get Text and then convert that to number with Num()

 

Names Default To Here(1);

//Text Edit Box
User_Input = New Window("N Col",
	<<modal(),
	H List Box(Text Box("Enter Column No:  "), Col_Num_teb = Text Edit Box("", <<set width(200)), ),
	Button Box("OK", col_num = col_num_teb << get text),
);
show(Num(col_num));

//number edit box
User_Input = New Window("N Col",
	<<modal(),
	H List Box(Text Box("Enter Column No:  "), neb = Number Edit Box(., <<set width(50)), ),
	Button Box("OK", col_num = neb << get),
);
show(col_num);
-Jarmo
Thierry_S
Super User

Re: N Col using textbox value

Hi,

Unless you convert your text/string into a number, the LineUpBox call will not work. Try replacing the Text Edit Box () with a Number Edit Box

User_Input = New Window( "N Col", << modal(),
	hlistbox(
		Text Box( "Enter Column No:  " ),
		Col_Num_neb = Number Edit Box ( 1 ), // You can replace "1" by any other initial value
	),
	Button Box( "OK", 
		col_num = col_num_neb << get; // You don't need the parentheses here
	),
);

lb = LineUpBox( N Col(col_num) );
Thierry R. Sornasse