Re: JESS: Get the current year

"Ernest Friedman-Hill" <[email protected]>
Newsgroups gmane.comp.java.jess
Message-ID <[email protected]>
On Aug 31, 2010, at 11:58 PM, Donald Winston wrote:

> int year = Calendar.getInstance().get(Calendar.YEAR);
>
> But you have to use static methods. Jess doesn't appear to let you  
> do this.
>


Sure it does! Two different ways to write this:


1)

(import java.util.Calendar)
(bind ?year ((Calendar.getInstance) get (Calendar.YEAR)))

2)

(import java.util.Calendar)
(bind ?year ((call Calendar getInstance) get (get-member Calendar  
YEAR)))


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            [email protected]
Livermore, CA 94550                             http://www.jessrules.com





--------------------------------------------------------------------
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].
--------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.