Aashu
unread,Mar 15, 2012, 2:18:13 PM3/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CLIPSESG
Hi All,
I need to fetch the Slot Names from CLIPS for a Multislot Field (which
is a part of a USER defined class) from C/C++ code.
I tried to use EnvSend/a sample deffunction which prints the Slot
Names, but none of them produced the desired result, might be I am
missing something.
So is there any way through which I can retrieve the Slot Names/Values
for a MultiSlot.
Eg:
(defclass Card (is-a USER)
(role concrete)
(pattern-match reactive)
( slot CardNumber (type STRING) )
( multislot InfoList (type INSTANCE) )
)
(defclass CardInfo (is-a USER)
(role concrete)
(pattern-match reactive)
( slot BinRange (type STRING) )
)
(defrule Abc
?card<-(object (is-a Card)(CardNumber ?card.CardNumber))
(test (starts-with ?card.CardNumber "AT2"))
=>
(make-instance [cardinfo] of CardInfo)
(slot-insert$ ?card InfoList (+ 1 (length$ (send ?card get-InfoList)))
(instance-address [cardinfo]))
)
Now I need to have some output through C function which returns like
this, which has both Class Name and Object Names in that Multislot.
(send [Instance of Card] print)
or,
[Instance of Card Class i.e. card1] of Card
(CardNumber "AT210000001234")
(Card CardInfo<Instance-Name of CardInfo class Object1 i.e. cardinfo>
ClassName2<Instance-Name of class Object2>)
Any guidance in this matter would be appreciated.