Hi Jim, I need help with my most advances script yet. in a nut shell, the script will ask the use to enter a register number between 1-5
the script does nothing when I add a while statement or if statement. if add one expression only without the while or if statement it works fine.
but I am trying to half works for multiple registers, I normally get files for individual registers and wanted to use a single script to cover all 5 variety.
thanks in advance.
Sam
full script below
w = New Window( "Enter Register number to Analyze", // opens a window with a title and this content...
Border Box( top( 20 ), bottom( 20 ), Left( 160 ), Right( 160 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Type in Register number below" ) ), // a second title, centered
Spacer Box( size( 1, 10 ) ), // a little vertical space
// H List Box( Text Box( "value 1: " ), Number Edit Box( v1 ) ), // data entry
H List Box( Text Box( "Enter Register Num:" ), Register_Num_teb = Text Edit Box( "", <<set width( 200 ) ), ),
Spacer Box( size( 1, 10 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Continue", // this script runs when the button is pressed...
Register = Register_Num_teb << get text();
// make a new table with the values...
///////////////////////////////////////////////////////////////////////////////////////////starting the loop
While( Register == 1,
dothis = Expr(
New Column( "start_time", Numeric, Continuous, Formula( (:rise_time_scope_v_vout * 1000) / 0.8 ) )
);
dothis;
dt << MoveSelectedColumns( {:start_time}, After( :Register1_active ) );
dothis = Expr(
New Column( "SoftStart_Accuracy%",
Numeric,
Continuous,
Formula( ((:Register1_tsoftstart - :start_time) / :Register1_tsoftstart) * 100 )
)
);
dothis;
dt << MoveSelectedColumns( {:SoftStart_Accuracy%}, After( :start_time ) );
);
While( Register == 2,
dothis = Expr(
New Column( "start_time", Numeric, Continuous, Formula( (:rise_time_scope_v_vout * 1000) / 0.8 ) )
);
dothis;
dt << MoveSelectedColumns( {:start_time}, After( :Register2_active ) );
dothis = Expr(
New Column( "SoftStart_Accuracy%",
Numeric,
Continuous,
Formula( ((:Register2_tsoftstart - :start_time) / :Register2_tsoftstart) * 100 )
)
);
dothis;
dt << MoveSelectedColumns( {:SoftStart_Accuracy%}, After( :start_time ) );
);
While( Register == 3,
dothis = Expr(
New Column( "start_time", Numeric, Continuous, Formula( (:rise_time_scope_v_vout * 1000) / 0.8 ) )
);
dothis;
dt << MoveSelectedColumns( {:start_time}, After( :Register3_active ) );
dothis = Expr(
New Column( "SoftStart_Accuracy%",
Numeric,
Continuous,
Formula( ((:Register3_tsoftstart - :start_time) / :Register3_tsoftstart) * 100 )
)
);
dothis;
dt << MoveSelectedColumns( {:SoftStart_Accuracy%}, After( :start_time ) );
);
While( Register == 4,
dothis = Expr(
New Column( "start_time", Numeric, Continuous, Formula( (:rise_time_scope_v_vout * 1000) / 0.8 ) )
);
dothis;
dt << MoveSelectedColumns( {:start_time}, After( :Register4_active ) );
dothis = Expr(
New Column( "SoftStart_Accuracy%",
Numeric,
Continuous,
Formula( ((:Register4_tsoftstart - :start_time) / :Register4_tsoftstart) * 100 )
)
);
dothis;
dt << MoveSelectedColumns( {:SoftStart_Accuracy%}, After( :start_time ) );
);
While( Register == 5,
dothis = Expr(
New Column( "start_time", Numeric, Continuous, Formula( (:rise_time_scope_v_vout * 1000) / 0.8 ) )
);
dothis;
dt << MoveSelectedColumns( {:start_time}, After( :Register5_active ) );
dothis = Expr(
New Column( "SoftStart_Accuracy%",
Numeric,
Continuous,
Formula( ((:Register5_tsoftstart - :start_time) / :Register5_tsoftstart) * 100 )
)
);
dothis;
dt << MoveSelectedColumns( {:SoftStart_Accuracy%}, After( :start_time ) );
);
///////////////////////////////////////////////////////////////////////////////////////////
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);