procedure TForm2.MaskEdit1Change(Sender: TObject);
var
Present: TDateTime;
hour,Min, Sec, MSec,Year, Month, Day,tmp: Word;
begin
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);
if Hour+strtoint(maskedit1.text)<24 then begin
datenow:=now;
dtp2.Time :=encodetime(Hour+strtoint(maskedit1.text), Min, Sec, MSec);
end
else begin
decodedate(present,Year, Month, Day);
case month of
1,3,5,7,8,10,12:tmp:=31;
2:tmp:=28;
4,6,9,11:tmp:=30;
end;
if day+1<=tmp then
datenow:=encodedate(Year, Month, Day+1)
else
datenow:=encodedate(Year, Month+1, 1);
dtp2.Time :=encodetime(Hour+strtoint(maskedit1.text)-24, Min, Sec, MSec);
end;
edit4.Text :=floattostr(strtofloat(maskedit1.text)*strtofloat(box1.Text)*strtofloat(box2.text));
end;