Names Default To Here( 1 );
// Create the Skeleton Table
dt = New Table( "2019 Run Times",
Add Rows( 0 ),
New Column( "Run ID", Character, "Nominal", ),
New Column( "Run 1", Numeric, "Continuous", ),
New Column( "Run 2", Numeric, "Continuous", ),
New Column( "Run 3", Numeric, "Continuous", ),
New Column( "Run 4", Numeric, "Continuous", ),
New Column( "Run 5", Numeric, "Continuous", ),
New Column( "Run 6", Numeric, "Continuous", ),
New Column( "Run 7", Numeric, "Continuous", ),
New Column( "Run 8", Numeric, "Continuous", ),
New Column( "Run 9", Numeric, "Continuous", ),
New Column( "Run 10", Numeric, "Continuous", ),
New Column( "Run 11", Numeric, "Continuous", );
);
// Make a UI to allow the values to be entered
cols = dt << getColumnNames( "String", Continuous, Nominal );
lub1 = Lineup Box( N Col( 1 ) );
lub2 = Lineup Box( N Col( 1 ) );
For( c = 1, c <= N Items( cols ), c++,
lub1 << Append( Text Box( cols[c] ) );
lub2 << Append( Number Edit Box( . ) );
);
nw = New Window( "Enter Runtime Data",
<<onClose( makeGraph ),
Lineup Box( N Col( 2 ), lub1, lub2 ),
Lineup Box( N Col( 2 ), Button Box( "Add", addScript ), Button Box( "Cancel", nw << closeWindow ) )
);
// Add a new row to dt when required
addScript = Expr(
dt << addRows( 1 );
lastRow = N Row( dt );
For( c = 1, c <= N Items( cols ), c++,
Column( dt, c )[lastRow] = (lub2[c] << get);
lub2[c] << set( . );
);
);
// Then I'm not sure how to refer to a specific value in a column.
// As there will be numerous Run IDs - So eventually, I want to
// refer to a specific Run ID, and use it's specific values for the
// calculations in another table