If Slide1.RESP = "{SPACE}" ' using the {key} nomenclature from online
E-Basic Help
If Slide1.RESP <> ""
If Slide1.RT > 0 ' or "<>" if you prefer
If Slide1.RT ' you don't even need the explicit test in this case
If Slide1.RTTime > 0 ' etc. as in .RT test
If you had also set the Correct response to {SPACE}, then you could also use
If Slide1.ACC = 1
If Slide1.ACC <> 0
If Slice1.ACC ' once again, do not need explicit test in this case
Also note that E-Basic/Visual Basic itself is case insensitive, so you
may use whatever case you like, except that you must observe case for
the E-Basic {key} nomenclature.
I leave it as an exercise to the reader to figure out the corresponding
tests for the case of more than one allowable response, or how to test
for the occurrence of a non-response (or non-occurrence of a response?).
You may post your solutions here for extra credit.
-- David McFarlane, Professional Faultfinder and Insufferable Pedant
> I have a slide that I am looping through (time out at 100ms). Each time
> I change one of the values on the slide (random number). The subject is
> supposed to press a key to stop it and then I do some calculations with
> what ever the random number was at the time. I would like the subject
> to do this with the space bar. When I set the allowable response to
> {SPACE} and my inline do a check: If Slide1.RESP = " " and I have also
> tries If Slide1.RESP = chr(32), it does not work. If I set the
> allowable response to 1 and do the check If Slide1.RESP = "1", It works
> perfectly. I would think that I need something in my if statement other
> than " " or chr(32).
>
> Anyone have any ideas? Thanks.
BTW, if I were looping through a slide and just wanted to stop when the
subject responds to any presentation, I might try another EP trick.
Instead of even getting a response to each slide presentation, I might
put a Wait object (let's call it ResponseWait) before my slide loop. I
would make its Duration 0, set it collect my desired response, and
(here's the key) set Time Limit to "(infinite)" or the max duration of
my slide loop. The PST User's Guide calls this Extended Input, see the
much overlooked Appendix C. I would probably also set its End Action to
Terminate so that it will terminate the current slide when the subject
responds, unless I wanted to allow the final slide to time-out on its
own. Anyway, then in my script or whatever I would just test for a
response to ResponseWait instead of my slides.
I really don't know if this makes things any better in your case, but I
had an experiment where this technique solved a lot of problems.
> I had an experiment where this technique solved a lot of problems.
Sorry to keep posting in piece-meal fashion, but just to explain a bit...
We had a task where we rapidly looped through a set of slides (i.e., new
slide on each screen refresh) and wanted to stop when the subject
responded. I first did it as you described, testing for a response to
the slides themselves. But much of time the program would not detect
the subject response. When I thought it through and looked at the
timing, I realized that in this case the program spent a good proportion
of its time between each slide, whereas it could collect responses only
during each slide's run; e.g., if a slide appeared every 17 ms, with 7
ms for in-between-slide setup and 10 ms of actual slide running (even
though it does remain on the screen for the full 17 ms), my program got
responses only during the 10 ms interval so 7/17 = 40% of the time my
program could not get a response!
I solved the problem using one pre-loop object with extended input as
described in my previous post, and I have described this just in case it
can ever do anyone else any good.
>I only had the few minutes to get it set up
<unsolicited-editorial-rant>
That illustrates the bigger problem here. Behavioral research labs
today seem to think that they can do research in a rush, and so do
not allow time to do things properly. Back in my graduate training
in the early 1980s, my advisor at the University of Chicago actually
reminded me that science is a deliberative process, and I needed to
slow down and take more time to ponder things. Seems our culture has
abandoned those values, taking an abundance of whiz-bang technology
as a substitute for timely deliberation. As for me, I do not find
that an improvement. But then I am a cranky old geezer.
</unsolicited-editorial-rant>