J'ai besoin d'un script qui examine toutes les colonnes et colorie les cellules avec la valeur « < LOD ». Mon script ne donne pas le résultat souhaité. Des conseils ?
dt = Current Data Table();
// Get all of the column names in the data table
ColNames = dt << get column names( string );
NRows = N Rows( dt );
// Loop through each column and row to find "< LOD" and color the previous cell
For( i = 1, i <= N Items( ColNames ), i++,
column = Column( dt, ColNames[i] );
For( j = 2, j <= NRows, j++, // Start at row 2 to avoid coloring out-of-bound cells
If( Row(j) == "< LOD",
column << Color Cells( j - 1, "Red" );
)
);
);
D’autres solutions plus élégantes sont plus que bienvenues !
Cela recherche la valeur « F » mais donne très probablement quelques idées sur ce que vous pourriez modifier (obtenir toutes les lignes au préalable pour chaque colonne, colorer l'ordre des arguments des cellules, ...)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
colnames = dt << get column names(character, string);
For Each({colname}, colnames,
r = Loc(dt[0, colname], "F");
If(N Items(r) > 0,
Column(dt, colname) << Color Cells("Red", r);
);
);
Write();
Modifier : suppression de Show(r); inutile de la boucle