button response does not correspond to correct image

31 views
Skip to first unread message

Jinjia Lin

unread,
Sep 18, 2016, 3:45:30 AM9/18/16
to E-Prime
I am doing a delay discounting experiment and i have the following Inline 

If decision.RESP="1" Then

c.SetAttrib"left","picture//hand.jpg"
c.SetAttrib"right","picture//black.bmp"

ElseIf decision.RESP="3" Then


c.SetAttrib"right","picture//hand.jpg"
c.SetAttrib"left","picture//black.bmp"

End If

--------------------
The problem now is when I run the experiment, whenever I press 1 it shows me the hand.jpg on the right (when it shld be on the left according to the code)
Yet when I press 3, it shows the correct corresponding image (e.g. when i press 3, the hand.jpg appears on the right.

Can someone enlighten me on this? Thanks!

David McFarlane

unread,
Sep 20, 2016, 5:24:38 PM9/20/16
to e-p...@googlegroups.com
What happens if you give no response? What happens if you enter a
response other than "1" or "3"? Can you use MsgBox before the If-Then
to verify the value of RESP going into the If-Then? What happens if you
use inline code to assign the RESP value, instead of using the actual
response? E.g.,

decision.RESP = "1"
If decision.RESP="1" Then
...

Basically, you want to think of things that you can do in order to echo
values at guaranteed known times during the program run, and to see
absolutely what paths the execution takes under absolutely known conditions.

BTW, instead of double forward slashes ("picture//hand.jpg") you should
either use double backslashes ("picture\\hand.jpg") or single forward
slashes ("picture/hand.jpg") -- single forward slashes are preferred in
all EP versions going back to EP1 -- but that has no bearing on the
question that you ask.

-- David McFarlane
Reply all
Reply to author
Forward
0 new messages