looping sounds

David McFarlane mcfarla9 at msu.edu
Fri May 9 14:31:19 UTC 2008


Jessica,

At 5/9/2008 07:45 AM Friday, James Keidel wrote:
>the order you need to test things is check whether there is a
>correct response, and if there is not then you check the value of the
>toneCount.

Just to complete James' thought, here is the script (with a bit of 
rearangement, and adding comments):

toneCount = toneCount + 1
If (toneCount <= 5) And (TrainingSound2.RESP <> "{SPACE}"> Then
    Goto Label2  ' repeat the training loop
Else
     toneCount = 0  ' reset counter for next time
     Goto Label3  ' exit the training loop
End If


BTW, if the movie object immediately follows this inline script, then 
you shouldn't even need the final Goto.  Also, strictly speaking, 
since the first Goto jumps you out of the If ... Then, you don't even 
need the Else clause (although it may improve readability if you 
leave it in).  Putting all those together, the script might become simply:

toneCount = toneCount + 1
If (toneCount <= 5) And (TrainingSound2.RESP <> "{SPACE}"> Then
     Goto Label2  ' repeat the training loop
End If
' Training loop completed, reset counter for next time:
toneCount = 0
' And move on to the movie ...


But now I'm getting too pedantic.

-- David McFarlane, Professional Faultfinder


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list