From 7d6510a853ab57dbc850c4568fb144bf8e4c2baf Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Sat, 15 Feb 2014 18:55:23 +0100 Subject: [PATCH] Ispis.mod dodat --- kodovi/fajlovi/ispis.mod | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 kodovi/fajlovi/ispis.mod diff --git a/kodovi/fajlovi/ispis.mod b/kodovi/fajlovi/ispis.mod new file mode 100644 index 0000000..6b897e4 --- /dev/null +++ b/kodovi/fajlovi/ispis.mod @@ -0,0 +1,31 @@ +MODULE ispis; +FROM FIO IMPORT File, Exists, Open, Close, EOF, RdStr; +FROM InOut IMPORT WriteString, WriteLn, ReadString; + +PROCEDURE ispisF(ime: ARRAY OF CHAR); +VAR + f:File; + s : ARRAY[1..100] OF CHAR; +BEGIN + IF Exists(ime) THEN + f:=Open(ime); + EOF := FALSE; + WHILE NOT EOF DO + RdStr(f,s); + WriteString(s); + WriteLn; + END; + Close(f); + ELSE + WriteString("-- fajl ne postoji --"); + WriteLn; + END; +END ispisF; + +VAR + ime: ARRAY[1..100] OF CHAR; +BEGIN + WriteString("unesite ime fajla:"); + ReadString(ime); + ispisF(ime); +END ispis. -- 2.25.1