I think Dan wrote:
[Charset Windows-1252 unsupported, filtering to ASCII...]
> Hello, I am trying to perform a simple (I suspect) action where the
> appropriate message is displayed according to what the user enters. I
> can get the system to ask the question, but get a list of error messages
> following the input. Hope someone can help as I just can't see the
> problem.
> 
> (defrule read-value
> (initial-fact)
> =>
> (printout t "Please enter a value" crlf)
> (assert (x (read)))

Assuming you're typing "1", here you're asserting a fact
"(x 1)". Asserting a fact is a perfectly lovely thing to do, but it's 
entirely different than assigning to a variable -- and the latter
seems more appropriate for what you're trying to do. So instead you
should change this line to 

        (bind ?x (read))

and then the code below will work fine.

> (if (> ?x 70)
> then
> (printout t "X is big" crlf)
> else
> (printout t "X is small" crlf)))
> 

Asserting a fact is a good way to pass the value you've collected from
one rule to another, but within a single rule it doesn't do you any
good. 


---------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to