Choose Language Hide Translation Bar
Highlighted
GardDog
Level III

Is there a way for my user input box to accept a "pasted" value using a JMP script?

Hi, I have a script that has a couple user input boxes. I had been just typing in the values, but wanted to see if there was a setting or something that can be changed on that input box for it to accept a value that has been copied and pasted into that box? When I try this it just leaves the box blank and does not accept a value. I have attached the user input box portion of my script as needed. Thanks in advance for any input. 

Clear Symbols();
Names Default To Here( 1 );

framex_value = "";
lotid_value = "";
w = New Window( "Requested Information", // opens a window with a title and this content...
	<<Return Result,
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "Requested Information..." ) ), // a second title, centered
			Spacer Box( size( 1, 20 ) ), // a little vertical space
		    H List Box( Text Box( "             Lot#: " ), lotid = Number Edit Box( "." ) ), // data entry
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H List Box( Text Box( "Frame size X: " ), framex = Number Edit Box( "." ) ), // data entry	
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H Center Box( // center the button
				Button Box( "Create graph", // this script runs when the button is pressed...
					lotid_value = lotid << get;
					framex_value = framex << get;
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
David_Burnham
Super User

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

Are you saying that when you paste something from the clipboard it doesn't appear in the display box?  It should - so long as the data type is correct.  You have Number Edit Boxes - these can only take numeric values so wont accept a value if it is text (and they probably are not too happy with you setting the initial value to "." ).

-Dave

View solution in original post

Highlighted
txnelson
Super User

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

The "." is the standard JMP display of a missing numeric value. It does not have to be removed, If treated as a decimal point then you paste, all will be well. You can enter the data into a Text Edit Box(), and convert the value to numeric behind the scenes. I have done this in the past, but when I do, I add in code to validate the entered value is numeric, and if not, I display an error window, and delete the bad value.
Jim

View solution in original post

5 REPLIES 5
Highlighted
David_Burnham
Super User

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

Are you saying that when you paste something from the clipboard it doesn't appear in the display box?  It should - so long as the data type is correct.  You have Number Edit Boxes - these can only take numeric values so wont accept a value if it is text (and they probably are not too happy with you setting the initial value to "." ).

-Dave

View solution in original post

Highlighted
txnelson
Super User

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

I have to ditto @David_Burnham .  I tested out your code on a Windows box and as long as I was pasting in a numeric value, it worked great.

Jim
Highlighted
GardDog
Level III

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

Thanks, interesting. So I am actually able to do it if I clear out the "." and paste a value, and then click somewhere else in the window and the value shows up. Is there a way to remove that "." so that you are able to just paste in the box and not have to clear out the ".". I ended up testing a Text Edit box and it does not have the "." there, and accepted my numerical value. Even if I remove setting that "." value from my script it is still showing up there? 

Also after pasting the value you have to click somewhere or hit enter for it to show up, you cannot just have it show up after you paste it?

Thanks again for all the help!

 

Highlighted
txnelson
Super User

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

The "." is the standard JMP display of a missing numeric value. It does not have to be removed, If treated as a decimal point then you paste, all will be well. You can enter the data into a Text Edit Box(), and convert the value to numeric behind the scenes. I have done this in the past, but when I do, I add in code to validate the entered value is numeric, and if not, I display an error window, and delete the bad value.
Jim

View solution in original post

Highlighted
GardDog
Level III

Re: Is there a way for my user input box to accept a "pasted" value using a JMP script?

Awesome, sounds good. Thanks for the explanation. Makes sense. I will leave it as is.

Article Labels