gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5fffd8)
raw | patch | inline | side by side (parent: d5fffd8)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sat, 15 Feb 2014 17:41:42 +0000 (18:41 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sat, 15 Feb 2014 17:45:37 +0000 (18:45 +0100) |
kodovi/fajlovi/nizslog.MOD | patch | blob | history |
index 051680dffac0476ad5132ef1262a7d9e07cf5a09..e427bfa8a8c7755ef86e8e8136f6c947f3bd14ca 100644 (file)
MODULE nizslog;\r
FROM InOut IMPORT WriteString, WriteLn, WriteCard,\r
ReadCard, ReadString;\r
-FROM FIO IMPORT File, Open, Create, Close, EOF,\r
+FROM FIO IMPORT File, Exists, Open, Create, Close, EOF,\r
RdItem, RdCard, WrStr, WrCard, WrLn;\r
FROM Str IMPORT Compare;\r
\r
CONST\r
MaxStud = 100;\r
+ radnifajl = "studenti.txt";\r
TYPE\r
String = ARRAY[1..30] OF CHAR;\r
Student = RECORD\r
f:File;\r
BEGIN\r
n:=0;\r
- f:= Open(fajl);\r
- EOF := FALSE;\r
- WHILE NOT EOF DO\r
- INC(n);\r
- RdItem(f, spisak[n].prez);\r
- RdItem(f, spisak[n].ime);\r
- spisak[n].god := RdCard(f);\r
+ IF Exists(fajl) THEN\r
+ f:= Open(fajl);\r
+ EOF := FALSE;\r
+ WHILE NOT EOF DO\r
+ INC(n);\r
+ RdItem(f, spisak[n].prez);\r
+ RdItem(f, spisak[n].ime);\r
+ spisak[n].god := RdCard(f);\r
+ END;\r
+ Close(f);\r
END;\r
- Close(f);\r
END UcitajF;\r
\r
PROCEDURE Ispisi(spisak:Studenti; n:CARDINAL);\r
\r
VAR\r
spisak : Studenti;\r
- fajl:String;\r
n:CARDINAL;\r
BEGIN\r
- fajl:="studenti.txt";\r
- UcitajF(fajl, spisak, n);\r
+ UcitajF(radnifajl, spisak, n);\r
Ispisi(spisak, n);\r
NoviStudent(spisak,n);\r
- IspisiF(fajl, spisak, n);\r
+ IspisiF(radnifajl, spisak, n);\r
END nizslog.
\ No newline at end of file