In CLIPS 6.3, there are two C functions, EnvGetInstancePPForm and EnvGetFactPPForm, that will return the printed representation of an instance or a fact. You can iterate over the facts/instances and save that representation to later recreate the facts/instances. The drawback is that the buffer passed to the functions is fixed to whatever it's initially set. In CLIPS 6.4, the equivalent functions are InstancePPForm and FactPPForm and these use a data structure that will expand the string buffer needed...
The ppfact function allows you to specify a logical name, so if you want to use a custom router you can iterate over the facts and use ppfact to direct the output to a logical name recognized by the router. CLIPS (6.31 6/12/19) CLIPS> (assert (a) (b) (c)) <Fact-3> CLIPS> (open "facts.out" out "w") TRUE CLIPS> (foreach ?f (get-fact-list) (ppfact ?f out)) CLIPS> (close out) TRUE CLIPS>
70x Dynamic fact slot modification and test case updates
The Windows IDE doesn't support editing text files. Edit your code using whichever text editor you prefer and then load it into the IDE by using the Load Constructs... menu item from the Environment menu.
70x constructs-to-c updates
70x constructs-to-c updatesq
(get-char) followed by a tab then enter produces different results
Checked in a fix to the repository.