cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
elad
Level I

Need help with getting input from a Text Edit Box

Hi All, 

I need help with getting input from a "Text Edit Box". After the user inputs the Lot Number (Lot_Num variable), i wanna use it as a numaric/text value. when i try to print Lot_Num, i can see that the output is not the string the user put in the "Text Edit Box".

This value will need to be placed in a new row for existing data table.

 

User_Input = New Window( "Enter Lot Number",
Text Box( "Enter Lot Num:" ),
Lot_Num = Text Edit Box( "", <<set width( 200 ) ),
Button Box( "Click To Save", User_Input << close window ),
);
Print( Lot_Num );

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Need help with getting input from a Text Edit Box

The "Lot_Num" variable that you are referencing, is not the value of the Text Edit Box(), but rater a pointer to the object.  Here is an example from

     Help==>Scripting Index==>Text Edit Box

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Box( "Example Text" )
);
Print( text << Get Text() );
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Need help with getting input from a Text Edit Box

The "Lot_Num" variable that you are referencing, is not the value of the Text Edit Box(), but rater a pointer to the object.  Here is an example from

     Help==>Scripting Index==>Text Edit Box

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Box( "Example Text" )
);
Print( text << Get Text() );
Jim
elad
Level I

Re: Need help with getting input from a Text Edit Box

Did the trick. Thx...

pmroz
Super User

Re: Need help with getting input from a Text Edit Box

The lot_num variable points to the text edit box, not the text itself.  Here's some code that shows how to get the value, and also uses a modal window so that processing stops until you click OK.

User_Input = New Window( "Enter Lot Number", << modal(),
	hlistbox(
		Text Box( "Enter Lot Num:" ),
		Lot_Num_teb = Text Edit Box( "", <<set width( 200 ) ),
	),
	text box("Click OK to save"),
	Button Box( "OK", 
		lot_num = lot_num_teb << get text();
	),
);
Print( Lot_Num );