trigger the response

Sara Agosta sara.agosta at gmail.com
Fri May 8 18:59:08 UTC 2009


Thank you very much!
the term Slide was only an exemple sorry... what I do not understand is the
"magic number"?
I've never used that script can you help me and explaining what does this
mean?

Thank you so much for your help!

On monday I'll try the new script for the response and I'll let you know!

thanks
sara

2009/5/8 David McFarlane <mcfarla9 at msu.edu>

>
> Oops, in my hasty copy & paste, I myself forgot to change the name of
> "Slide" in my examples.  Please change "Slide" to something like
> "StimSlide".  Sorry.
>
> -- David McFarlane, Professional Faultfinder
>
>
> At 5/8/2009 10:18 AM Friday, David McFarlane wrote:
>
> >I don't know about anything else, but the code as written will
> >produce an error because the name "Slide" is reserved.  You cannot
> >have a Slide named simply "Slide", you will need to change that to
> >"Slide1" or "StimSlide" or whatever.
> >
> >Also, on a style and efficiency note, there is no need to do two
> >separate If-Then tests on .ACC, you only need to test once for
> >whether it or not it equals 0 and then branch as necessary, thus:
> >
> >If (Slide.Acc = 1) Then
> >      WritePort &H378, c.GetAttrib("Trigger") + 100
> >Else
> >      WritePort &H378, c.GetAttrib("Trigger") + 200
> >End If
> >
> >Knowing that any non-zero value evaluates to "True", you could get
> >rid of the explicit test and further compact this to simply:
> >
> >If Slide.Acc Then
> >      WritePort &H378, c.GetAttrib("Trigger") + 100
> >Else
> >      WritePort &H378, c.GetAttrib("Trigger") + 200
> >End If
> >
> >Finally, let's get rid of the "magic number" and use a constant (and
> >ideally, put the constant in the global User Area):
> >
> >Const LptDataPort as Integer = &H378
> >If Slide.Acc Then
> >      WritePort LptDataPort, c.GetAttrib("Trigger") + 100
> >Else
> >      WritePort LptDataPort, c.GetAttrib("Trigger") + 200
> >End If
> >
> >But to truly compact and obfuscate this, you could use the venerable
> >Iif() function, thus:
> >
> >Const LptDataPort as Integer = &H378
> >WritePort LptDataPort, c.GetAttrib("Trigger") + Iif( Slide.Acc, 100, 200 )
> >
> >-- David McFarlane, Professional Faultfinder
> >
> >
> >At 5/7/2009 04:41 PM Thursday, Sara wrote:
> >
> > >Hi, I'm running an experiment with e prime while I'm recording the EEG
> > >(with analyzer), I would like to trigger te response (correct or
> > >answer) can you help me?
> > >
> > >I thought this was the right :
> > >
> > >If Slide.Acc= 1 then WritePort &H378, c.GetAttrib ("Trigger")+ 100
> > >If Slide.Acc= 0 then WritePort &H378, c.GetAttrib ("Trigger")+ 200
> > >
> > >can you help me?
> > >Thank you very much!
> > >Sara
> >
> >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20090508/83fecc3a/attachment.htm>


More information about the Eprime mailing list