var
CurrCont: TDateTime = 0;
Str: String;
Days: array[1..7] of string;
procedure SumCont(Cont: String);
begin
if Length(Cont) > 8 then CurrCont := CurrCont + StrToDateTime(Copy(Cont, Length(Cont) - 7, 8)) + StrToFloat(Copy(Cont, 0, Length(Cont) - 9))
else CurrCont := CurrCont + StrToDateTime(Copy(Cont, Length(Cont) - 7, 8));
end;
function GetSumCont(): String;
begin
if CurrCont >= 1 then
begin
Str := DateTimeToStr(CurrCont);
Str := IntToStr(Trunc(CurrCont)) + 'сут. ' + Copy(Str, Length(Str) - 7, 8);
//Str := IntToStr(Trunc(CurrCont) * 24 + StrToInt(Copy(Str, Length(Str) - 7, 2))) + Copy(Str, Length(Str) - 5, 6);
end
else
begin
Str := DateTimeToStr(CurrCont);
Str := Copy(Str, Length(Str) - 7, 8);
end;
if CurrCont = 0 then
begin
Str := '';
end;
CurrCont := 0;
result := Str;
end;
begin
Days[1] := 'Воскресенье';
Days[2] := 'Понедельник';
Days[3] := 'Вторник';
Days[4] := 'Среда';
Days[5] := 'Четверг';
Days[6] := 'Пятница';
Days[7] := 'Суббота';
end. |