Always mystified by how to use Eval Expr correctly. I have this pop up that asks for a wildcard column name selection and assigns it as "Divider"
nw = New Window( "Does the Data Contain Experimental Cells?",
<<Modal,
V List Box(
Align( "right" ),
H List Box(
Panel Box( "Dividing Column", clb = Filter Col Selector( dt, all ) ),
Panel Box( "Select Cell Identification Column",
Lineup Box( N Col( 2 ), Spacing( 5 ),
Button Box( "Divider", clbY << Append( clb << Get Selected ) ),
clbY = Col List Box( MinItems( 1 ), MaxItems( 1 ), nlines( 1 ) ),
Button Box( "Remove",
clbY << Remove Selected;
clbEffects << Remove Selected;
)
)
)
),
H List Box(
Button Box( "OK", yVars = clby << Get Items( "Column Reference" ) ),
Button Box( "Cancel" )
)
)
);
Try( Divider = yVars[1] );
I then try to evaluate the object in a column formula and whatever combination of Eval(Eval Expr( I use, nothing seems to work.
If( N Items( yVars ) == 0,
Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater )
)
)
),
Eval(Eval Expr(Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater, As Column(Expr(Divider)) ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater, :HD_NUM, As Column(Expr(Divider)) )
)
)
)
)));
Slán
SpannerHead