Thank you for the responses!  The test trick worked.  I thought I tried
that,
but with all the changes/testing I was doing, I probably messed
something
up.

Now, can you tell me why I cannot use bind on the LHS?  How can I
set a variable to be used in another CE?  In the following, I just want
to set ?c1 to the first character in CCC, and use it in the following
CE,
instead of having to repeat the CCC1 function for each equality test.

---- code snippet---
(deffunction CCC1(?c)
    "return the first character from the cargo category code"
    (sub-string 1 1 ?c))

(defrule Hazardous-containerized
    (tRec (CCC ?c))
    (bind ?c1 =(CCC1 ?c))
    (test (or (eq ?c1 "D") (eq ?c1 "E") (eq ?c1 "K") (eq ?c1 "L")))
    =>
    (printout t "c1= " ?c1)
    (assert (itemCommodity "Hazardous Not Containerized")))

---end---

This forum is great - without alot of examples to look at,
I need the help!  Thanks,

KathyLee Simunich
Argonne National Lab

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to