Choose Language Hide Translation Bar
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted
elad
Level I

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

Did the trick. Thx...

Highlighted
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 );
Article Labels

    There are no labels assigned to this post.