I think I just answered this one - I guess I'd better put this in the
FAQ. Compile and install this Userfunction; the syntax is then

(find-slot-value ?fact-id ?slot-name)

public class FactSlotValue implements Userfunction
{
  public String getName() { return "fact-slot-value"; }
  public Value call(ValueVector vv, Context context) throws ReteException
  {
    Fact f = new Fact(context.getEngine().findFactByID(vv.get(1).factIDValue()),
                      context.getEngine());
    return f.findValue(vv.get(2).stringValue());
  }
}

I think H�kan Lindgren wrote:
> 
> Is there some way to access a certain slot in a deftemplate.
> You know the number of the fact, and want to get the value from a
> specific slot in that fact. How do I do? 
> 
> Thanks in advance for any response.  / Hakan
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [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. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to