I am trying to have the user enter several variables, once those variables are deemed ok, then the ok button goes from greyed out to active. I got this working. What I do not have working is the Eval Expr (outputs). This is just a simple thing just to make sure I have this working before I do the calculations. When I run the script, here is a screen shot, the OK button is greyed out:
Then I put plausible values and the ok button shows active after I click the verify inputs:
But it is not running my expression and creating the table. What am I doing wrong? I am on JMP 16.0 Pro. Like I said I did something very simple like create a table just to make sure my script is working before I do a deep dive to what I really need.
Names Default To Here( 0 );
Clear Log();
w = New Window( "Variables",
<<modal,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ),
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Enter the Variables for the Calculations" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ),
H List Box( Text Box( "α: " ), alpha_ent = Number Edit Box() ),
Spacer Box( size( 1, 30 ) ),
H List Box( Text Box( "β: " ), beta_ent = Number Edit Box() ),
Spacer Box( size( 1, 30 ) ),
H List Box( Text Box( "N: " ), N_ent = Number Edit Box() ),
Spacer Box( size( 1, 30 ) ),
H List Box( Text Box( "%: " ), Percent_ent = Number Edit Box() ),
Spacer Box( size( 1, 30 ) ),
H List Box( Text Box( "p0: " ), p0_ent = Number Edit Box() ),
Spacer Box( size( 1, 30 ) ),
H Center Box(
Button Box( "Verify Inputs", // this script runs when the button is pressed...
alpha = alpha_ent << get;
beta = beta_ent << get;
N = N_ent << get;
percent = percent_ent << get;
p0 = p0_ent << get;
i = 1;
DOEN = 0;
For( i = 1, i < 10, i++,
If( 2 ^ i == N,
DOEN = DOEN + 1
)
);
If(
Abs( alpha ) >= 1 | alpha == 0,
alphaw = New Window( "Error!",
<<modal,
Text Box(
"Alpha needs to be between 0 and 1, please fix and try again"
),
),
Abs( beta ) >= 1 | beta == 0,
betaw = New Window( "Error!",
<<modal,
Text Box(
"Beta needs to be between 0 and 1, please fix and try again"
),
),
DOEN == 0,
nw = New Window( "Error!",
<<modal,
Text Box(
"N should be 2\!U1D3A, do not include centerpoints or repeats with N, please fix and try again"
),
),
Abs( percent ) > 90 | percent == 0,
percentw = New Window( "Error!",
<<modal,
Text Box(
"The percent needs to be between 0 and 90%, please fix and try again"
),
),
Abs( p0 ) > 0.90 | p0 == 0,
p0w = New Window( "Error!",
<<modal,
Text Box(
"The p0 needs to be between 0 and 0.90, please fix and try again"
),
)
);
If(
Abs( alpha ) >= 1 | Abs( beta ) >= 1 | DOEN == 0 |
Abs( percent ) > 90 | percent == 0 | Abs( p0 ) > 0.90 | p0 ==
0 | alpha == 0 | beta == 0, bb << Enable( 0 ),
bb << Enable( 1 ),
Eval Expr( output )
);
)
),
bb = Button Box( "OK" ),
bb << Enable( 0 );
)
)
);
Show( alpha );
Show( beta );
Show( DOEN );
Show( percent );
Show( p0 );
output = Expr(
dt = New Table( "Test Table",
New Column( "a", Set Values( {alpha, beta, N, percent, p0} ) )
);
w << closeWindow;
);