Specify key press before proceding to the next trial

David McFarlane mcfarla9 at msu.edu
Fri Oct 4 14:08:59 UTC 2013


Deiniol,

How about

     If ( (CInt(Stage1Word.InputMasks(1).RESP) <= 9) and _
         (strHit = "Result") ) Then
     ...

?

Explanation:  Convert RESP to an integer first so you do a numeric 
comparison instead of a string comparison (and use the number 9 
instead of the string "9").  And while you are at it, use a single 
"<=" comparison operator instead of separate "<" and "=" operators.

Alternatively, you might limit the *length* of the response to one 
character (which means, if Allowable allows only numberic characters, 
limiting to one digit).  Thus,

     If ( (Len(Stage1Word.InputMasks(1).RESP) = 1) and _
         (strHit = "Result") ) Then
     ...

So there's more than one way to skin this cat.  Hope this helps, I 
may have missed some complication, but I'm sure you will come up with 
something.

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
take any and all questions at https://support.pstnet.com , and they 
strive to respond to all requests in 24-48 hours, so make full use of 
it.  3) In addition, PST offers several instructional videos on their 
YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
get an answer from PST staff, please extend the courtesy of posting 
their reply back here for the sake of others.
\----


At 10/4/2013 06:26 AM Friday, Deiniol Skillicorn wrote:
>David McFarlane,
>
>Thank you for a quck response.  I have read many of your eprime 
>google group reponses.
>
>I have specified key presses  using the follwign code
>
>If  ((Stage1Word.InputMasks(1).RESP < "9")) or 
>((Stage1Word.InputMasks(1).RESP = "9")) and (strHit = "Result") Then
>'Goto label2
>     Stage1Word.InputMasks(1).Timeout
>     Stage1Word.InputMasks(2).Timeout
>   End If
>
>This works! However, it will still allow multiple digit responses 
>(e.g. 55 or 76 or 879). I have 
>tried  ((Stage1Word.InputMasks(1).RESP < "10"))  but this only 
>allows responses of 1.  Presumably it doesn't recognise the second digit 0.
>
>Any hints would be appreciated
>
>Regards
>
>Deiniol

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/524ecbfe.48e1320a.1374.42a4SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list