I think =?iso-8859-1?q?un=20ethix?= wrote:
>
> I would like to:
> 1)create/open a file
> 2)save a jess output to that file
>
> E.g. using the command:
> (printout filename.txt "abc")
>
> And I don't know enough about how routers work (in Jess) to know why filename.txt is
> a 'bad router'. I imagine that I need to 'open' the file first, to be able to direct
> the output to it; but apart from opening it in an editor my imagination falls short.
>
Well, just as in Perl, there's always "more than one way to do it" in
Jess. For this particular application, there are a set of simple
file-handling functions you can use. You can use "open" to open a file
for writing and assign a router name to it, then you can use printout
with that new router, and then use "close" to close the file:
(open "filename.txt" myfile "w")
(printout myfile "abc" crlf)
(close myfile)
> I'm not looking for an explanation on how routers work - I should know this and I
> will find out, but I would like to know what command I should use (e.g. through the
> JESS console) to print the output to a file, in much the same way as I might print
> it to the standard output.
>
> Thanks again Ernest,
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------