cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ehchandlerjr
Level V

User Entry with Number Edit Box not working

Hello - I've got this confusing issue where I have a nested number edit box, and for some reason its not sending the entered number into the variable I've got it set to. I tried selecting and running only that line, and low-and-behold it sends the info to the variable, but for some reason in context, it refuses to do it. I actually got it to work a while ago, but then I went to bed, got up, didn't change a thing before it (I changed the script it calls as well as added a couple of "write to column" lines farther down), and this happened, so I'm a bit confused. Here's the code up to the <<get line, but if you want the whole code, its attached in a file:

Clear Symbols();

w = New Window( "Choose Row Number for XRD Run input", // opens a window with a title and this content...
	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( "Choose Row Number for XRD Run input" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box( rowtemp = Number Edit Box( 116 ) ), // data entry
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H Center Box( // center the button
				Button Box( "Import Smaple Data", // this script runs when the button is pressed...
					rownumber = rowtemp << Get;

Also, side question, but when I get to the w << close window statement, it says

Send Expects Scriptable Object in access or evaluation of 'Send' , w << /*###*/closeWindow/*###*/

, which confuses me, because again, this worked earlier, and it also follows the syntax correctly. If anyone knows why that's happening, that would be helpful too.

 

 

Thanks in advance.

Edward Hamer Chandler, Jr.
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: User Entry with Number Edit Box not working

I would set the value within the Number Edit Box using a <<set function

Clear Symbols();

w = New Window( "Choose Row Number for XRD Run input", // opens a window with a title and this content...
	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( "Choose Row Number for XRD Run input" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box(
				rowtemp = Number Edit Box(
					116,
					10,
					<<SetFunction( Function( {thisBox}, rownumber = thisbox << get ) )
				)
			), // data entry
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H Center Box( // center the button
				Button Box( "Import Smaple Data", // this script runs when the button is pressed...
					//rownumber = rowtemp << Get
				)
			)
		)
	)
);
Jim

View solution in original post

ehchandlerjr
Level V

Re: User Entry with Number Edit Box not working

@txnelson Thanks for the suggestion! I've added it in.

 

Unfortunately it didn't do much. My firewall is blocking the debugger for some reason, so I had to resort to wait/show commands, and realized I was less familliar with the Clear Symbols() function than I thought. My called script started with a clear variables command, so that accounted for the killing of the rownumber variable, as well as the w << Close Window command not working, as "w" was being removed as well.

 

Methinks I don't understand namespaces enough.

 

Thanks for the help!

Edward Hamer Chandler, Jr.

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: User Entry with Number Edit Box not working

I would set the value within the Number Edit Box using a <<set function

Clear Symbols();

w = New Window( "Choose Row Number for XRD Run input", // opens a window with a title and this content...
	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( "Choose Row Number for XRD Run input" ) ), // a second title, centered
			Spacer Box( size( 1, 30 ) ), // a little vertical space
			H Center Box(
				rowtemp = Number Edit Box(
					116,
					10,
					<<SetFunction( Function( {thisBox}, rownumber = thisbox << get ) )
				)
			), // data entry
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H Center Box( // center the button
				Button Box( "Import Smaple Data", // this script runs when the button is pressed...
					//rownumber = rowtemp << Get
				)
			)
		)
	)
);
Jim
ehchandlerjr
Level V

Re: User Entry with Number Edit Box not working

@txnelson Thanks for the suggestion! I've added it in.

 

Unfortunately it didn't do much. My firewall is blocking the debugger for some reason, so I had to resort to wait/show commands, and realized I was less familliar with the Clear Symbols() function than I thought. My called script started with a clear variables command, so that accounted for the killing of the rownumber variable, as well as the w << Close Window command not working, as "w" was being removed as well.

 

Methinks I don't understand namespaces enough.

 

Thanks for the help!

Edward Hamer Chandler, Jr.
jthi
Super User

Re: User Entry with Number Edit Box not working

In very short for namespaces:

And both of these are good reads: Global and Local Variables (jmp.com) and Rules for Name Resolution (jmp.com) (remember to check also subtopics)

-Jarmo