hi,
i want to read data from the file
(data.txt). and want to use these prolog predicate like
a(book)
a(computer)
a(phone)
a(pen)
a(pencil)
i have two file. "file.pl" and
"data.txt"
file.pl like
this.
a(T):-see('file.pl'),
repeat,
read_atom(T) , ( T=end_of_file -> true,! ;fail ),
seen.
or
a(T):-open('file.pl',read,S),
read_atom(S,T) , ( T=
at_end_of_stream -> true ; read_atom(S,T), fail ), close(S).
i try but i couldn't. how
should be a correct true "file.pl"
file.
________________________________________________________________________________
ömer
külahcı
türk
hava yolları a.o. genel
müdürlük binası, yatırım yönetimi başkanlığı AR-GE müdürlüğü, 10.
kat
34149
yeşilköy / istanbul tel: (212) 463
63 63 / 2096 fax: (212) 465 20
97
turkish
airlines inc. general management building, dir. investment management, mng.
research & development, floor 10
34149
yeşilköy / istanbul / turkey phone: (+90 212) 463 63 63 / 2096 fax: (+90 212) 465 20 97