assert fact into file in prolog

Posted by smile on Stack Overflow See other posts from Stack Overflow or by smile
Published on 2010-05-21T21:31:54Z Indexed on 2010/05/22 0:20 UTC
Read the original article Hit count: 463

Filed under:

Hello everyone,

How can I assert a fact into a file without deleting the previous fact?

In the following line, when I execute it twice, the second fact overwrites the first fact:

tell('animal.txt'),write(Animal),nl,told.

But when I use assert or assertz it will do nothing.

Help me please.

Thank you :)

© Stack Overflow or respective owner

Related posts about prolog