Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project13;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils;
- type data = record
- dzien: 1..31;
- miesiac: 1..12;
- rok : Integer;
- end;
- type pracownik = record
- imie: String[20];
- nazwisko: String[20];
- data_ur: data;
- end;
- var t:pracownik;
- tab: array[0..9] of pracownik;
- TF : TextFile;
- S: String;
- i, temp:Integer;
- begin
- try
- t.imie:='Jan';
- t.nazwisko:='Kowalski';
- t.data_ur.dzien:=4;
- t.data_ur.miesiac:=5;
- t.data_ur.rok:=1929;
- i:=0;
- temp:=0;
- AssignFile(TF, 'C:\Documents and Settings\student.LAB-144-13\Pulpit\PP\pracownicy.txt');
- Reset(TF);
- while Not Eof(TF) do
- begin
- ReadLn(TF, tab[i].imie);
- ReadLn(TF, tab[i].nazwisko);
- ReadLn(TF, tab[i].data_ur.dzien);
- ReadLn(TF, tab[i].data_ur.miesiac);
- ReadLn(TF, tab[i].data_ur.rok);
- i:=i+1;
- temp:=temp+1;
- end;
- CloseFile(TF);
- for i := 0 to temp-1 do
- begin
- Write(tab[i].imie + ' ');
- Write(tab[i].nazwisko + ' ');
- Write(tab[i].data_ur.dzien , ' ');
- Write(tab[i].data_ur.miesiac , ' ');
- WriteLn(tab[i].data_ur.rok , ' ');
- end;
- ReadLn;
- except
- on E: Exception do
- Writeln(E.ClassName, ': ', E.Message);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement