I am using pillow to develop an interface to some existing, complex, planning tools written in sicstus prolog as part of my final year project at university.
The planning tools output using write statements.
In order to run a test on the web I used the following code extract.
compute_reply('',_,'') :- !.
compute_reply(File,Test,Reply) :-
['planner.pl'],
Reply = [ --, 'The result is ', test1, '.',\].
I need to run a test, which basically requires me to call a function called test1
Of course if I do this before the Reply = [ ] then the test executes and as this is before the valid html output in the main it causes an error.
However if I try to call it in the reply statement for example
Reply = ['The results are ', test1, '.' ,\]. then it is taken as a string and the output is
'The results are test1'
So I was wondering if there was a way of running a test within the Reply initialisation.
Unfortunately Sicstus does not seem to be able to redirect the stream to a string as this would prbably have solved the problem.
I would prefer not to change the planner if at all possible.
Thankyou for any help you can provide.
______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com