Hello Ernest
This is a snippet from a mail I had sent earlier if you remember
" i tried to get a string value from jess and return it back to jess but I get a no such variable text message when I run the jess program - I am not sure why.
Working with string value:
(deffunction inputstring (?EVENT)
(bind ?arg (sym-cat (?*argcombo* getSelectedItem)))
(compute ?text ?arg)
(printout t ?text))
(bind ?handler (new jess.awt.ActionListener inputstring(engine)))
(?*ok* addActionListener ?handler)
public class test2 implements Userfunction
{
public String getName () {return "compute";}
public Value call(ValueVector vv, Context c)throws JessException
{ Value abc = vv.get(2).resolveValue(c);
String result = abc.stringValue(c);
Value res = new Value(result, RU.STRING);
c.setVariable(vv.get(1).variableValue(c), res);
return res;}} "
You mentioned that you tested my code and it seemed to work fine. I was still having problems so I left this problem and went on to work on something else. After I returning to this program I now get an error saying Bad index 3 in call to get() on this vector (compute ?text ?arg). I am totally baffled. What does this error mean?
I also mentioned that I tested the userfunction with integers which works fine (ie adding two integers and retrning the result).
Suggestions from others also welcome.
Jenny
Do you Yahoo!?
Better first dates. More second dates. Yahoo! Personals
