The script at the end of this post basically does what I want it to do (i.e., finding columns where a Y-value is 100 for time = 0), but it also generates a log message that makes me a little uncomfortable (having stepped into traps before):
A message with an empty Boolean argument enabled an option that was already enabled. That option remains enabled. In previous versions of JMP, this would have disabled the option.
This message is printed to the log for every column that is selected again, after it has already been selected once as part of my loop construction. As someone relatively new to scripting, I have two main concerns:
- Is this log message something I absolutely should avoid and will I run into trouble? I will eventually be processing larger tables, so this log message may be printed hundreds of times for a single script execution.
- Is there a smarter way to find all columns in a table that have a Y-value = 100 for each row where time = 0? (In my case, I will be processing tables with many columns, some of them containing results that are normalized to 100% rel. at time =0. These are the columns I am interested in.)
Names Default To Here( 1 );
// table required for example
dt = New Table( "Results (absolute & relative) vs time",
Add Rows( 8 ),
New Column( "time",
Numeric,
Set Values( [0, 1, 2, 3, 0, 1, 2, 3] ),
),
New Column( "Y1_absolute",
Numeric,
Set Values( [7, 8, 1, 9, 0.2, 0.4, 0.65, 0.98] ),
),
New Column( "Y1-relative",
Numeric,
Set Values( [100, 114, 14, 129, 100, 200, 325, 490] ),
),
New Column( "Y2_absolute",
Numeric,
Set Values( [12, 6, 4, 0, 80, 90, 120, 75] ),
),
New Column( "Y2_relative",
Numeric,
Set Values( [100, 50, 33, 0, 100, 113, 150, 94] ),
)
);
// selecting columns where for :time == 0 a Y-value == 100 is found
For( i = 1, i <= N Row( dt ), i++,
For( j = 1, j <= N Col( dt ), j++,
If( Column( j )[i] == 0,
For( k = 1, k <= N Col( dt ), k++,
If( Column( k )[i] == 100,
Column( k ) << Set Selected
)
)
)
)
);