(defrule list
(row (name ?name)(value ?b))
(test( = (str-index new ?name) 1))
=>
.......)
Ashraf Afifi
"Skokan, Ladislav" <[EMAIL PROTECTED]> on 03/28/2000 07:17:41 AM
Please respond to "Skokan, Ladislav" <[EMAIL PROTECTED]>
To: "Jess Mailing List" <[EMAIL PROTECTED]>
cc: (bcc: Ashraf Afifi/Bsg/MetLife/US)
Subject: JESS: Something like patterns in Jess
Hello All
I am new in Jess/Lisp and I am faced to solve such problem:
This is simplified example:
>>>>>>>>>>> code
(deftemplate row (slot name) (slot value))
(assert (row (name new) (value 1)) )
(assert (row (name news) (value 1)) )
(defrule list (row (name new) (value ?b)) => (printout t "List:" ?b crlf ))
(run)
>>>>>>>>>>>>>> code
I now need to list each row , where name STARTS with or CONTAINS the word
"new".
This example lists only words exactly maching name "new".
Does anybody have any idea how to do it ?
Thanx,
Laco Skokan.
---------------------------------------------------------------------
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]
---------------------------------------------------------------------