If you use Calendar.set, it has two parameters, so you can't use (call ?futureCal set "Calendar.HOUR, 8") which has a single string argument. It should be (call ?futureCal set (Calendar.HOUR) 8) Note that static members are imported as Jess functions!
And the error you are showing is with Calendar.get, which does have a single argument, but not a string - it's an int, e.g. (call ?futureCal get (Calendar.HOUR)) Again, the static Calendar.HOUR needs to be written as function call. -W On Tue, Feb 2, 2010 at 6:43 PM, Yasir Khalid <y.k.tha...@gmail.com> wrote: > Hai There, > I am having difficult time to use "Calendar" Class from Java API in jess, > I am planning to use this class my simple jess script. But i just got stuck > on the seting up the date detail (e.g: Year) in jess. > Once I run following script on eclipse. > >> (reset) >> (watch all) >> (import java.util.Calendar) >> (bind ?futureCal (Calendar.getInstance)) >> (call ?futureCal set "Calendar.HOUR, 8") >> > > > But, i would have an error ; > > Jess reported an error in routine call >> while executing (call ?futureCal get "Calendar.HOUR, 8"). >> Message: No overloading of method 'get' in class >> java.util.GregorianCalendar I can call with these arguments: (call >> ?futureCal get "Calendar.HOUR, 8"). >> Program text: ( call ?futureCal get "Calendar.HOUR, 8" ) at line 5 in >> file /home/jess/workspace/HelloWorld/src/HelloWorld.clp. >> > > It is saying the 'get' method is not under GreogorianCalendar class, but if > i am referring to > this<http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html>, > it is already inherited form 'Calendar' class. > Any suggestion about above error? > Thanks for the attention > -- > - Yasir - >