This question comes on the heels of a closely related discussion we've
been having about working with defqueries. Short answer: the version
of fact-slot-value in jess/scriptlib.clp can be replaced by this
improved version:
(deffunction fact-slot-value (?__fact ?__name)
"Fetch the value from the named slot of the given fact"
(return (call ?__fact getSlotValue ?__name)))
which will accept the variable ?*status* as an argument, as you would
expect it to. This new version will be the standard one in the next
Jess release.
As to your sensibleness question: as the kids say, "It's all good."
I think Mark Lilly wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
>
> I am trying to retrieve a value from a fact.
>
> First i initialize a fact and bind to ?*status*
> (bind ?*status* (assert (stopvalue (status 0))))
>
> Periodically i modify the status slot.
> (modify ?*status* (status -1))
>
> Later, i want to retrieve that status value (is it 0 or -1?).
>
> This here works, but only if i know the fact-id number:
> (bind ?x (fact-slot-value 5 status))
>
> What i want to do is this, using the global variable for the fact:
> (bind ?x (fact-slot-value ?*status* status))
>
> But, i don't know how to get the number '5' from the global '?*status*'
>
> Two things.
> One, how do i do this?
>
> Two, is this a sensible way of achieving this end? I am new to this, so
> don't know all the good techniques.
>
> Thanks,
> mark
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------