var
i,j,k,len:integer;
//holiday:array of Tdate;
tmpdate:Tdate;
tmplist:tstringlist;
begin
len:=period;
if length(holiday)<1 then
begin
tmplist:=tstringlist.Create;
getcode('节假日','content',tmplist,true,false);
setlength(holiday,tmplist.Count);
for i:=0 to tmplist.count-1 do
holiday[i]:=_strtodatetime(tmplist.strings[i]);
tmplist.Destroy;
end;
i:=0;
while i<=len do
begin
j:=DayOfWeek(CurDate+i);
if (j=1) or (j=7) then
len:=len+1
else
for k:=0 to length(holiday)-1 do
begin
tmpdate:=curdate+i;
if int(tmpdate)=int(holiday[k]) then
begin inc(len);break;end;
end;
inc(i);
end;
setlength(holiday,0);
result:=CurDate+len;