Hello again,
   
  I followed Ernest's advice and I have modified your program. The only thing 
that I have done is that I put the test CE after the pattern matching.
   
  Here it is the modified program:
   
  (reset)
  (defglobal ?*currentOpenToolbar* = MasterToolbar)
  
  (deftemplate toDisplayToolbar
  (slot toolbar)
  (slot visible))
  
   
  (defrule 1stTime
  (toDisplayToolbar (toolbar ?toolbar) (visible ?v&:(eq ?v TRUE)))
  (test (= ?*currentOpenToolbar* MasterToolbar)) 
  =>
  (printout t "1st Time" crlf)
  (bind ?*currentOpenToolbar* ?toolbar)
  (printout t "?*currentOpenToolbar is now " ?*currentOpenToolbar* crlf))
  
   
  (defrule SubsequentTime
  (toDisplayToolbar (toolbar ?toolbar) (visible ?v&:(eq ?v TRUE)))
  (test (<> ?*currentOpenToolbar* MasterToolbar))
  =>
  (printout t "Not1stTime" crlf)
  (bind ?*currentOpenToolbar* ?toolbar)
  (printout t "?*currentOpenToolbar is now " ?*currentOpenToolbar* crlf))
  
   
  (watch all)
  
  (assert (toDisplayToolbar
  (toolbar PenToolbar)
  (visible FALSE)))
  (run)
  
  (assert (toDisplayToolbar
  (toolbar PenToolbar)
  (visible TRUE)))
  (run)
  
  (assert (toDisplayToolbar
  (toolbar Anothertoolbar)
  (visible TRUE)))
  (run)
  

Best regards,
  Ana Tanasescu

       
---------------------------------
OMG, Sweet deal for Yahoo! users/friends: Get A Month of Blockbuster Total 
Access, No Cost. W00t

Reply via email to