Да)) В гриде много строк. Вот я делаю так:
Код:
procedure TForm1.Button1Click(Sender: TObject);
var
BeginDate, EndDate: Tdatetime;
r: integer;
begin
for r:= 1 to StringGrid1.RowCount do
begin
if (stringgrid1.Cells[0, r]<>'')or(stringgrid1.Cells[1, r]<>'') then
begin
BeginDate:= StrToDate(Stringgrid1.Cells[0, r]);
EndDate:= StrToDate(Stringgrid1.Cells[1, r]);
if (StrToDate(StringGrid1.Cells[0,r+1])>BeginDate)and(StrToDate(StringGrid1.Cells[0,r+1])<EndDate) then
showmessage(StringGrid1.Cells[0,r+1] + ' входит в период ' + ' от '+ DateToStr(BeginDate) + ' по ' + DateToStr(EndDate));
end;
end;
end;
Вроде всё работает, НО всё-же по окончанию выдает ощибку