E-Prime 2.0 Problem

Aaron stegner at education.wisc.edu
Wed May 23 19:01:56 UTC 2012


Hello all,

Our lab is in the process of switching all of our E-Prime protocols
from 1.x to 2.0 and I am having some problems with the transition. The
issue appears to be with the Inline script I am using to allow
respondents to scroll a rating scale. Basically the script was adapted
from the "State of a Key or Button" script found in the E-Prime
Samples collection. When run in 1.x the script shows a slide of the
scale for 150 ms in a loop while polling the assigned port for a
change in the state of one of three buttons on our response box. The
position of a red arrow is altered, moved up or down the scale, when
buttons 1 (UP) and 2 (DOWN) are pressed. The third button (SELECT)
allows respondents to indicate their rating. The purpose for the loop
and monitoring for the button release is that it allows respondents to
press and hold either the UP or DOWN buttons and quickly scroll the
scale rather than having to repeatedly hit the button to move from one
number to another. After opening the script in 2.0 (Professional) the
scale stopped working. The scale is responding as if it does not
recognize the releases. I checked the settings and the device is still
set to detect presses and releases. A single press of the UP or DOWN
button causes the arrow to slide all the way to one end of the scale
regardless of how long it is held down. The arrow will respond to
presses of either button, but it will not stop moving until it hits
one end. Also the script appears to hold the last button press in
memory from one display of the scale to the next. That is, if I hit
the UP button once at the beginning of the protocol run the arrow will
respond to that button press every time the scale is displayed unless
I hit one of the other two buttons. Just to be clear, the 1.x version
runs without issue. It is only when I open the same script in 2.0 that
I run into this problem. Below is a copy of my Inline script and the
necessary variables defined in my User script:

nPresses = Port2.History.Count
Set lastPress = Port2.History(nPresses)
Set arrow =
CSlideVisualStim(Intensity.States("Default").Objects("Text16"))

While (clock.readmillisec - scaleStartTime1 < scaleDuration) and not
done
		If lastPress Is Nothing Then
			Goto Label1
		ElseIf Not lastPress Is Nothing Then
			Select Case lastPress.RESP
				Case "1"
				If yPos > scaleTop Then
				yPos = yPos -scaleInc
				End If
				Goto Label1
				Case "2"
				If yPos < scaleBottom Then
				yPos = yPos +scaleInc
				End If
				Goto Label1
				Case "-1,-2"
				yPos = yPos
				Goto Label1
				Case "3"
				done = true
				c.SetAttrib "IntRating",(573-yPos)/28
				arrow.BorderColor = CColor("red")
				Intensity.Draw
				Case Else
				Goto Label1
			End Select
		End If
wEnd

If not(done) then
	c.SetAttrib "IntRating",10000+(573-yPos)/28
	Goto Label2
End If


const buttonBoxPortAddress = &H3F8
Dim scaleTop as integer,scaleBottom as integer,scaleInc as integer
Dim scaleDuration as long,scaleStartTime1 as long,scaleStartTime2 as
long,stimInterval as long, runStartTime as long
Dim done as boolean
Dim arrow As SlideVisualStim
Dim nPresses as Long
Dim yPos as Integer
Dim lastpress as ResponseData

Any help would be appreciated. Thanks.

Aaron

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