Or more simply:

(assert (a "nice string"))
(assert (b nice)) ; note: "nice" (in quotes) won't work

(defrule r1
    (a ?x)
    (b ?y&:(member$ ?y (explode$ ?x)))
=>
    (printout t "Found!" crlf)
)

(run)

i.e. a non-zero value from (member$) evaluates in the pattern above like a TRUE - or like (neq FALSE ...))

alan


Henrique Lopes Cardoso wrote:
Hi,

I am having trouble in getting to multifields and strings.
I was trying to evaluate the contents of a string in a rule's LHS:

(assert (a "nice string"))

(defrule r1
   (a ?x)
   ?s <- (explode$ ?x)
   ?s <- (nice ?what)
  =>
   (printout t ?what crlf)
)

I know I cannot do this. But I cannot figure out how to do something like this...

Thank you.

Henrique

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


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