Spis treści

File writting

Description

Procedure which save data to a file „towary”

Source: PROLOG str. 81 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5

Download

Program source code: file_writting.pl

Listing

wyrob(towar1, 10, 10).
wyrob(towar2, 50, 220).
wyrob(towar3, 120, 500).
wyrob(towar4, 110, 80).
 
write_plik :- tell(towary), do_write, told.
 
do_write :- wyrob(Nazwa, Kod, Cena), write([Nazwa, Kod, Cena]), write(.), nl, fail.

Comments