I know it can be achieved making two rules, one which is satisfying conditions and the other just reverse of it
but i would like to know is there is easier way to have same functionality
example of having two rules to achieve else part:
(test (> ?first ?second) => (printout t " first is bigger") )
(test (< ?first ?second) => (printout t " second is bigger") )
actually if rule is simple then it is little easy to write two rules, but when it becomes bigger then flooding the rule file is little trouble, so please let me know if i can….
In general, there's no else condition for a rule. In a simple case such as this, you can move the expression into the then portion of the rule, but in more complex cases you need a second rule:
(if (> ?first ?second)
then (printout t " first is bigger")
else (if (> ?second ?first) then (printout t " second is bigger"))))
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.