I am still having problems but I going to sit on it for now (I just hope I am not overlooking something very minor). Meanwhile as I mentioned earlier I want to work with a Mysql database. I have managed to connect to the data base using a Userfunction and insert values in a table.
 
How would I be able to return multiple values of different types (eg. a client record - client id, name, address etc) to my Jess program without using multiple userfunctions (one for each value) after retrieving the values from the database.
 
Thanks
Jenny
 

[EMAIL PROTECTED] wrote:
I think sivan k wrote:

> Regarding the no such variable text error - I have not used
> ?text variable outside the function if I have understood you
> correctly.

Well, I don't know. I was curious enough to take your code and run it.
It works for me with your "test.java" exactly as shown (adding an
"import jess.*", of course), and with a few lines of initialization
added to the Jess code. I can select something from the combo box,
press the button, and get that thing printed. Because Jess 7 includes
some changes in how Context works, I tried this with both Jess 6 and
7; it works with both.

Here's my complete Jess program:

; ----------------------------------------------------------------------
(load-function test)
(import javax.swing.*)

(defglobal ?*argcombo* = (new JComboBox (create$ A B C)))
(defg! lobal ?*ok* = (new JButton OK))

(bind ?frame (new JFrame))
((?frame getContentPane) add ?*ok* "South")
((?frame getContentPane) add ?*argcombo* "Center")
(?frame pack)
(?frame setVisible TRUE)

(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)





---------------------------------------------------------
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]
--------------------------------------------------------------------


Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!

Reply via email to