unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst,DateUtils;
type
TForm1 = class(TForm)
Tage: TCheckListBox;
Einlesen: TMemo;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TageClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Tage.Items.SaveToFile('Tage.txt');
Einlesen.Clear;
Einlesen.Lines.Add(Datetostr(Now));
Einlesen.Lines.SaveToFile('Tag.txt');
end;
procedure TForm1.TageClick(Sender: TObject);
begin
Tage.Items.Delete(Tage.ItemIndex);
end;
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;Tag:TDate;
begin
Einlesen.Lines.LoadFromFile('Tag.txt');
Tage.Items.LoadFromFile('Tage.txt');
for i:=0 to Tage.Items.Count-1 do
if Tage.Items.Strings[i]='' then Tage.Items.Delete(i);
Tag:=strtoDate(Einlesen.Lines[0]);
repeat
incDay(Tag);
if DayOfWeek(Tag)=6 then Tage.Items.Add(Datetostr(Tag));
until Tag>=Now;
end;
end.