Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailemVyřešeno Delphi projekt

:d
var
Form5: TForm5;
pom,pom2,dd,mm,rr,d,m,r,p,j,s,k:string;
x,y,a,b,c,h:integer;
implementation

uses unit1,unit2;
{$R *.dfm}

procedure TForm5.Button2Click(Sender: TObject);
begin
form5.Close;
end;

procedure TForm5.Button1Click(Sender: TObject);
begin
dd:=combobox2.text;
mm:=combobox3.text;
rr:=combobox4.text;
x:=strtoint(mm)-3;
y:=strtoint(rr);
if x<1 then
begin
x:=12-x;
y:=strtoint(rr)-1;
end;
edit1.Text:=dd+'.'+inttostr(x)+'.'+inttostr(y);

assignfile(f,'databaze.dat');
if fileexists('databaze.dat')
then reset(f)
else
begin
showmessage('Databáze dosud neexistuje!');exit;
end;
listbox1.clear;
pom:=combobox1.Text;
if dat.datum<=edit1.text then
pom:=combobox1.Text;
while not eof(f) do
begin
read(f,dat);
if pom=dat.Skupina then
listbox1.items.add(dat.Prijmeni +' ' +dat.Jmeno+' ' +dat.Skupina+' ' +dat.Datum);
begin
p:=dat.prijmeni;
j:=dat.jmeno;
s:=dat.Skupina;
k:=dat.Datum;
end;
dd:=combobox2.text;
mm:=combobox3.text;
rr:=combobox4.text;
x:=strtoint(mm)-3;
y:=strtoint(rr);
d:=copy(dat.datum,1,2);
m:=copy(dat.datum,4,2);
r:=copy(dat.datum,7,4);
c:=strtoint(rr)-strtoint(r);
a:=strtoint(d)+strtoint(m)*30;
b:=strtoint(dd)+strtoint(mm)*30;
h:=0;
if c=0 then
begin
if (b-a)>=90 then
listbox1.items.add(p +' ' +j+' ' +s+' ' +k);
end
else
h:=(c*365-a)+b;
if h>=90 then
listbox1.items.add(p +' ' +j+' ' +s+' ' +k);

end;

closefile(f);
end;

end.

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny