这是程序片段
procedure usefile
{使用当前设置时间}
var
altimerh,inh,inm:integer;
finalfile:file of final;
altimer,hour:string;
timenow:tdatetime;
begin
if weekend then
begin
altimerh:=0;
altimer:='';
seek(finalfile,0);
read(finalfile,finaldata);
if finaldata.start then
form1.CheckBox1.Checked:=true;{若已添加在启动则选中单选钮}
correcttimer(altimerh,altimer);
if altimerh<10 then
hour:='0'+ inttostr( altimerh)
else
hour:= inttostr( altimerh);
tmal:= hour+':'+altimer
tmcl:=finaldata.final1+':'+ finaldata.final2;
end
else
begin
seek(finalfile,1);
read(finalfile,finaldata);
if finaldata.start then
form1.CheckBox1.Checked:=true;
correcttimer(altimerh,altimer);
if altimerh<10 then
hour:='0'+ inttostr( altimerh)
else
hour:= inttostr( altimerh);
tmal:= hour+':'+altimer
tmcl:=finaldata.final1+':'+ finaldata.final2;
end;
timenow:=now;
inh:= strtoint(hour)-strtoint(formatdatetime('hh',timenow));
inm:= strtoint(altimer)-strtoint( formatdatetime('nn',timenow));
form1.timer1.interval:= inh*60*60*1000+inm*60*1000;
end;
assignfile(finalfile,fname);
//
reset(finalfile);
usefile;{使用前函数};