Topic: colors grid

I'm new to mvd and I do not have experience
I tried to make a project and I have problem trying to put
colors grid sell with the next script


procedure FrmSearch_GridSearch_OnChange (Sender: string);
var
   i,c: integer;
   s: string;
begin
   c := FrmSearch.GridSearch.RowCount - 1;
     for i := 0 to c do
     begin
         s := FrmSearch.GridSearch.Cells[5,i];
         if ValidDate(s) then
             if (StrToDate(s) - 15) >= now then FrmSearch.GridSearch.Cell[5,i].Color := clGreen;
             if (StrToDate(s) - 30) < now then FrmSearch.GridSearch.Cell[5,i].Color := clYellow;
             if (StrToDate(s) - 1) < now then FrmSearch.GridSearch.Cell[5,i].Color := clRed;
     end;
end;




and sent me the following  eror ¨¨is not a valid date.
can somebody help me

Re: colors grid

Hello,


corrected script:

procedure FrmSearch_GridSearch_OnChange (Sender: string);
var
   i,c: integer;
   s: string;
begin
   c := FrmSearch.GridSearch.RowCount - 1;
     for i := 0 to c do
     begin
         s := FrmSearch.GridSearch.Cells[5,i];
         if ValidDate(s) then
         begin
             if (StrToDate(s) - 15) >= now then FrmSearch.GridSearch.Cell[5,i].Color := clGreen;
             if (StrToDate(s) - 30) < now then FrmSearch.GridSearch.Cell[5,i].Color := clYellow;
             if (StrToDate(s) - 1) < now then FrmSearch.GridSearch.Cell[5,i].Color := clRed;
         end;
     end;
end;
Dmitry.

Re: colors grid

Thanks
thank you so much
your script works fine
thank you again.