How to use file::save
Posted: 1 Apr 2021 0:13
I want to write a series of facts to a file, but I can't find any explanation about how to write facts to a file in any of the documentations. Only a few vague references that you can do it. Here is just a simple example of what I am trying to do
but this gives me
error c504 :The expression has type 'main::main@classDB', which is incompatible with the type '::factDB'
Can you point me to a good explanation of writing to files, or give me some basics here?
Code: Select all
class facts
testDB : (string Name).
class predicates
filltestDB : ().
clauses
filltestDB() :-
assert(testDB("Name1")),
assert(testDB("Name2")),
file::save("TestFile", testDB(_)).
error c504 :The expression has type 'main::main@classDB', which is incompatible with the type '::factDB'
Can you point me to a good explanation of writing to files, or give me some basics here?