Global variable script problem: type mismatch

Recursion infinityparadox at gmail.com
Sat Jul 25 14:52:39 UTC 2009


I'm having a little problem with a script I wrote to keep track of
subject responses. Just to clear up any ambiguity with the variable
names, know that a keyboard response of '1' indicates a "positive"
response--the subject agrees with the statement on screen. A keyboard
response of '4' is a negative response--disagreement.

The problem is that there is a time-out condition--subjects only have
5 seconds to respond. The script works fine, except in cases where the
slide is allowed to timeout. In such a case, I get a type mismatch
error pointing to the first line in the If statement. Here's the
script:

-------------------------------------------------------------------------------------------
'Calculates total trial number
'Calculates total number of positive subject resp
'Calculates total number of negative subject resp
g_nTotalTrials = g_nTotalTrials + 1

If InputSlide.RESP = 1 Then
	g_nTotalPositive = g_nTotalPositive + 1
ElseIf InputSlide.RESP = 4 Then
	g_nTotalNegative = g_nTotalNegative + 1
Else
End If

c.SetAttrib "TrialCounter", g_nTotalTrials 'set for display and
logging
c.SetAttrib "TotalPositive", g_nTotalPositive 'set for display and
logging
c.SetAttrib "TotalNegative", g_nTotalNegative 'set for display and
logging
------------------------------------------------------------------------------------------

Perhaps I should consider some sort of typecast? Is a failure to
respond of type bool? Come to think of it, I'm not entirely certain of
this. I have another script that runs a contingent branch on the slide
objects used for feedback. Here's that script:

----------------------------------------------
If InputSlide.RESP = "1" Then
     Feedback1.Run c
Else
     Feedback2.Run c
End If
----------------------------------------------

I'd like to change this to lead to a third feedback slide object in
the event that the subject fails to respond within 5 minutes--but to
do this I need to know how a failure to respond in time is even coded--
what its type is.

Thanks so much!
S

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