Hello all,
 
I'm having a bit of a problem implementing i/o routers in Jess. Using the std. ConsoleApplet example, I'm attempting to pose a question to the user (from a function) in the textAreaWriter, and receive their input from the textField (via the input router). It seems however that the result stored in a variable (if I bind the result) or in a fact (if I assert the result) is the -previous- piece of input... this is the same if I create a function in the UI... eg. (deffunction x() (printout t "ask q. ") (bind ?ans (readline)) (printout t "ans "?ans)).
 
Running (x) gives me "(x)" as the result - as in the last thing I typed in... Has anyone got any suggestions? I'm sure I'm doing something silly.
 
regards,
 
James.
 
ENC:
 
Sample of function:
 
(deffunction ask-human ()       
        (printout t "Maximising human quality from (1) spatial k., (2) scale k., (3) temporal k or (4) all? " ) ;; defining all a bit harder
        (bind ?hum-qual (read))       
        (if (eq ?hum-qual "1") then (assert (maximize spatial)))
        (if (eq ?hum-qual "2") then (assert (maximize sscale)))
        (if (eq ?hum-qual "3") then (assert (maximize temporal)))
        (if (eq ?hum-qual "4") then (assert (maximize all)))
        (printout t "User picked " ?hum-qual crlf)
        )
 
 
 
 
 

Reply via email to