%PDF- %PDF-
Direktori : /proc/thread-self/root/www/varak.net/www.varak.net/ |
Current File : //proc/thread-self/root/www/varak.net/www.varak.net/ws.pas |
program students; uses ws_main, crt; var o : byte; jmeno : string; vek : byte; d : dstudent; first : lpst; pom : lpst; begin first := nil; o := 1; while(o <> 0) do begin clrscr(); writeln('Waritko students'); writeln('1 : Zadej studenta'); writeln('2 : Vypis studentu'); writeln('3 : Vyhledavani studentu'); writeln('4 : Razeni studentu'); writeln('98: Nacteni ze souboru'); writeln('99: Zapis do souboru'); writeln('FF: O programatorovi (Credits)'); writeln('0 : Konec'); readln(o); case o of 1 : begin write('Jmeno : '); readln(d.jmeno); write('Prijmeni : '); readln(d.prijmeni); write('Vek : '); readln(d.vek); if(first = nil) then begin first := create(d); end else begin insert(first, d); end; end; 2 : begin clrscr(); print(first); readkey; end; 3 : begin writeln('1 : Podle jmena'); writeln('2 : Podle prijmeni'); writeln('3 : Podle veku'); readln(o); case o of 1 : begin write('Zadejte jmeno studenta: '); readln(jmeno); pom := find(first, 1, jmeno); end; 2 : begin write('Zadejte prijmeni studenta: '); readln(jmeno); pom := find(first, 2, jmeno); end; 3 : begin write('Zadejte vek studenta: '); readln(vek); pom := find(first, 1, vek); end; end; if(pom <> nil) then begin writeln('Udaje nalezeneho studenta:'); writeln('Jmeno: ', pom^.jmeno); writeln('Prijmeni: ', pom^.prijmeni); writeln('Vek: ', pom^.vek); writeln('Chcete studenta smazat (1) nebo ne (0)?'); readln(o); end else begin writeln('Zadny student nenalezen'); readkey; end; if(o = 1) then begin delete(first, pom); end else o := 99; end; 4 : begin writeln('1 : Podle jmena'); writeln('2 : Podle prijmeni'); writeln('3 : Podle veku'); readln(o); if((o > 0) and (o < 4)) then begin sort(first, o); end else begin writeln('Zadali jste nespravne cislo volby'); end; end; 98 : load(first, 'studenti.db1'); 99 : save(first, 'studenti.db1'); 255 : begin writeln('Created by Martin Varak'); readkey; end; end; end; end.