From: Doni Pracner Date: Sat, 15 Feb 2014 17:55:23 +0000 (+0100) Subject: Ispis.mod dodat X-Git-Tag: v14a~8^2~2 X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;ds=sidebyside;h=7d6510a853ab57dbc850c4568fb144bf8e4c2baf;hp=0395d88a1ace54c114124a122633a58017970ab6;p=spa1skripta-public.git Ispis.mod dodat --- 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.