I have a grid with column names a_4, a_4_1_2, a_5 and so on.
Values are integer, and I would like to print out the value only if it is not zero (if zero, set the field color to white).
I have problems with macro sc_field_color.
I put the following code inside the OnRecord event and it works .
if ({a_4}<>0)
{
sc_field_color(“a_4”, “#000000”);
}
else {
sc_field_color(“a_4”, “#FFFFFF”);
};
If I try to use a variable to refer to the field name, I make some mistake, as the following code
$campo=“a_4”;
if ({$campo}<>0)
{
sc_field_color("$campo", “#000000”);
}
else {
sc_field_color("$campo", “#FFFFFF”);
};
I guess it is a stupid error from myself, I tried any kind of combination with or without the ".
The idea then, is to make a check for any field in the grid, using an array.
Thanks in advance for any suggestion