Hi @samir,
@Mark_Bailey has a really good starting point. I modified it slightly to what sounded like you were after -- the user entering a number.
Names Default To Here( 1 );
win = New Window( "Set a Value",
<<Modal,
//<<Return Result,
Text Box( "Set this value" ),
variablebox = Number Edit Box(
.,
<<Set Function(
Function( {my_value},
content = my_value << Get;
If( Is Missing( content ),
bb << Enable( 0 ),
bb << Enable( 1 )
);
)
)
),
bb = Button Box( "OK",<< Enable( 0 ), content = bb << Get );
);
Print("Value is "|| Char(content) );
You can also try the On Validate() option, but I think this returns a list of strings rather than a variable. In the above case, the new variable is "content", and could be passed to another function or JSL code that does something with it.
Also note, if you invoke the variablebox as a Number Edit Box, JMP knows not to allow anything but numbers, positive or negative. So, if they enter anything but a number, then the window stays open. I don't think it can handle imaginary numbers without a special add-in.
Hope this helps!,
DS