Hi Lode Hoste,
Unfortunately it didn't work.
I'm confuse and I do not know what to do!
On Mar 15, 1:12 pm, Lode Hoste <
zill...@gmail.com> wrote:
> Hi Nima,
>
> Try double quoting the "a".
>
> CLIPS> (eq "a" a)
> FALSE
> CLIPS> (eq "a" "a")
> TRUE
>
> 2012/3/15 Nima <
divoone0...@gmail.com>:
>
>
>
>
>
>
>
> > Hi all,
>
> > I have a problem that can not find any reason for it!
>
> > in a pattern-matching, when I use a variable that Initialized
> > manually, pattern-matching work correctly.
> > But when use a variable that Initialized by binding, pattern-matching
> > doesn't work.
>
> > for example, first code, return 72 and work correctly:
>
> > first code:
> > --------------------------------------------------------------------------
> > (deffunction Pass-Search (?x)
> > ?x)
>
> > (defglobal ?*OS* = Android)
>
> > (deffacts Mobile
> > (Mobile 71 Symbian)
> > (Mobile 72 Android))
>
> > (defrule Result
> > (Mobile ?name =(Pass-Search ?*OS*))
> > =>
> > (printout t ?name))
> > ----------------------------------------------------------------------------
>
> > But when ?*OS* gets its value from user by using binding, it doesn't
> > work correctly:
>
> > ------------------------------------------------------------------------------
> > (deffunction Pass-Search (?x)
> > ?x)
>
> > (defglobal ?*OS* = Android)
>
> > (deffacts Mobile
> > (Mobile 71 Symbian)
> > (Mobile 72 Android))
>
> > (defrule Questions
> > (declare (salience 20))
> > =>
> > (bind ?response
> > (ask-question "2- What Is Your Favorite OS? (A/B/C)" "A.
> > Android B. Windows C. Symbian" a b c))
> > (if (eq ?response a)
> > then
> > (bind ?*OS* Android)))
>
> > (defrule Result
> > (Mobile ?name =(Pass-Search ?*OS*))
> > =>
> > (printout t ?name))
>
> > --------------------------------------------------------------------------------------------
>
> > ask-question is one of my functions.
>
> > I hope someone can help me.
> > Nima
>
> > --
> > You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
> > To post to this group, send email to
CLIP...@googlegroups.com
> > For more options, visit this group athttp://
groups.google.com/group/CLIPSESG?hl=en
>
> > --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> > Visit this group athttp://
groups.google.com/group/CLIPSESG?hl=en
> > Click on "Edit my membership" link.
> > Select the "No Email" radio button.
> > Click the "Save these settings" button.
>
> > --> IF YOU WANT TO UNSUBSCRIBE <--
> > Visit this group athttp://
groups.google.com/group/CLIPSESG?hl=en