I think Ruetzel, Andreas wrote: > > Executing this command: getRete().executeCommand(" (facts) ") > Throws an exception Nomethodnamed'hasMoreElements'found > What can be the cause for this?
(facts) is implemented as a deffunction in jess/scriptlib.clp . The Java methods that (facts) calls have changed across various Jess versions. Is it possible that you're inadventently using an older copy of scriptlib.clp with a newer copy of Jess? In particular, the old implementation needed to call java.util.Enumeration.hasMoreElements() while the newer one calls java.util.Iterator.hasNext(), which sounds like the cause of the error you're seeing. > if ( !(tfin5.getText().compareTo("")== 0) && > !(tfin6.getText().compareTo("")== 0 )){ Just curious: why not use 'tfin5.getText().equals("")' ? Less typing, and clearer code, as well. > getRete().executeCommand(" (reset) "); Or equivalently, getRete().reset() . > > // tried to retract facts with functions > // after that with rules, but every time I run this command > // one fact more remains You don't show the functions, but it looks like you have two functions, just like you have two rules, each of which intended to retract one class of fact. Given that you've called "(reset)", there will also be an "(initial-fact)" fact in working memory -- is this the "extra" one that you can't get rid of? --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- 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] --------------------------------------------------------------------