First, you should add "put answer" in the code, which will put answer in
the message window, and you can see how it's different.
my guess is that the return is being added to the field, and so "C
<return>" is not the same as "C". If this is so, just delete the last
character of answer:
delete the last char of answer
before you check it.
that ought to do it....
--bhakti
Mark Bishop wrote:
>
> I'm new to the this listserv and new to Director, so please let me know if I
> deviate from your conventions.
>
> I'd like to do the following.
>
> 1. Have a user type an answer to a question in a field and press
> ENTER/RETURN.
> 2. Compare the answer to the correct answer and respond accordingly.
>
> The following is the barebones of the code I'm using to check if the user
> has correctly typed the symbol for the element carbon.
>
> on keyUp
> if the key = RETURN then
> answer = member("input field large").text
> if answer = "C" Then
> go "symbol correct"
> else
> go "symbol incorrect"
> end if
> end if
> end
>
> Typing "C" does not yield the correct response. If I put the same code
> (without the key = RETURN lines) under a button, it works fine. The
> ENTER/RETURN key seems to change the text. Any ideas on how I make this
> work? I don't want to use "contains" because I don't want "Ca" to be
> considered correct.
>
> Thanks
>
> -----------------------------------------------
> Mark Bishop
> Monterey Peninsula College
> [EMAIL PROTECTED]
> http://www.mpcfaculty.net/mark_bishop/
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
> email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo. Thanks!]
--
R. Bhakti Klein
Lingo Programmer, Scientific Learning
http://www.ScientificLearning.com
http://www.BrainConnection.com
**
Baritone, Wicki6
http://www.wicki6.com
***
"On Earth, you can only do little things;
but you can do them with a lot of Love."
-- Mother Theresa
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]