Dear Ernest,
I know that when the working memory is changed the rule will be reevaluated
You see when I said that with the following simple function my problem
disappeared I didn’t realize that in this example I initialize the global
variable calling that function and because of that my application works.
(deffunction read-number()
(printout t "Read the number")
(bind ?n (read))
(return ?n))
(defglobal ?*category* = (read-number))
It is possible to initialize a global variable using a value from a text field?
If the answer is yes how can I define that function?
I tried to put the defglobal construct in the following function but a
constructor can’t stay there:
(deffunction read-category(?EVENT)
(defglobal ?*category*=(integer(?*textfield* getText)))
(assert(insert(integer(?*textfield* getText)))))
If I define the global variable outside this function and bind it after with
the new value, still wont works because the rule won’t be reevaluated.
What shall I do?
Best regards,
Ana