dt = Open("C:/temp/Cars_modified.jmp");
//______________________________________________________________________________________
//A function to find the colored cells in a specific column.
//-15341335 = reddish color, 73 = yellowish, 36=greenish
get_colored_cells = Function( {col}, {_s,i, xp, clr_aa=0 },
// If IsMissing(clr) then get all colors
_s = col << get script ;
for(i=1, i<=narg(_s) , i++,
xp = Arg(_s, i);
if(Head Name(xp) =="Color Cells",
//this only works if the color is an integer might need a for loop to change the
//key to the RGB value
clr_aa = Associative Array(Arg(xp,1));
clr_aa << set default value(0);
Break()
);
);
clr_aa
);
//_______________________________________________________________________________________
// Usage examples:
model_aa = get_colored_cells( Column("Model"));
dt<< select rows (model_aa[73]);
I modified the above example to select yellowish cells, and it worked when there are multiple colors in the "Model" column. When there's only 1 color in the column, it doesn't work. How can I modify the script so that colored cells within the Model column can be selected when there's only 1 color that's used in the column?