I think Mong-Thao La wrote:
> Hallo,
> i have following java code for classes Deftemplate and Fact working with
> array.
> my program will not work.After running there are no facts .What ist wrong here
> in sytax and code ?

>                     if(slotType[i]=="double")

I think the major problem is a Java issue. The "==" operator compares
using object identity -- i.e., it tells you if two Strings (or in
general two objects) occupy the same physical location in memory. To
compare the contents of two Strings (or again, of two Objects) you
should use the "equals()" method, which compares the contents of the
Strings for equivalence. So everywhere you've got a line like the
above, change it to

>                     if(slotType[i].equals("double"))

and you should see substantial changes in the behavior of your program.




---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software 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]
--------------------------------------------------------------------

Reply via email to