This article applies to:
E-Prime 2.0
E-Prime 1.x
This bug was corrected in E-Prime 2.0 (2.0.1.66).
Symptoms
Under a specific scenario as described below, destroying an RteRunnableInputObject (TextDisplay, ImageDisplay, Slide, FeedbackDisplay, SoundOut, Wait) at runtime will cause the the Sync property settings for (vertical blank) to be ignored for all remaining objects in the experiment.
Detail
In this condition, data for OnsetTime values will be properly logged, but display tearing may occur since the objects do not wait for the top of screen to paint.
This issue does not affect Display.WaitForVerticalBlank.
This issue does not affect objects created from the Toolbox in the E-Studio GUI.
This situation only affects RteRunnableInputObject (TextDisplay, ImageDisplay, Slide, FeedbackDisplay, SoundOut, Wait) types that are created in script and are specifically set to the Nothing keyword prior to the end of the experiment.
NOTE: Psychology Software Tools discourages using script to create objects.
The following are two examples that will cause the issue to occur. The third example shows a situation where the problem would not occur
'EXAMPLE1: Using Dim and New keywords inside of a function
'Psychology Software Tools has always discouraged using script to create objects.
' The following code placed in User script section of the experiment in E-Studio
Sub DoSomething()
Dim x As TextDisplay
Set x = New TextDisplay
x.Text = "Hello World"
x.Duration = 5000
x.Run
'At the end of the routine, x goes out of scope which effectively calls Set x = Nothing and destroys x, the TextDisplay and
' any future RteRunnableInputObject (TextDisplay, ImageDisplay, Slide, FeedbackDisplay, SoundOut, Wait)
' used will cause the problem
'Instead, use E-Prime 1.2.1.846 or later OR E-Prime 2.0.1.66 or later
' OR perform the Dim in the User section of your experiment and either do not call Set x = Nothing until
' the last InLine in SessionProc or don't call Set x = Nothing at all which will be called internally for you at the end of the experiment
End Sub
'EXAMPLE2: Using Dim in UserScript and then using Set = Nothing before the end of the experiment
'Psychology Software Tools has always discouraged using script to create objects.
' The following code placed in User script section of the experiment in E-Studio
Dim x As TextDisplay
Sub DoSomething()
Set x = New TextDisplay
x.Text = "Hello World"
x.Duration = 5000
x.Run
'The following line will decrement the internal reference count for the variable x
' which will destroy it since it was only being reference once ( 1 - 1 = 0 )
' Since x is destoryed any future RteRunnableInputObject (TextDisplay, ImageDisplay, Slide, FeedbackDisplay, SoundOut, Wait)
' used will cause the problem
'Instead, use E-Prime 1.2.1.846 or later OR E-Prime 2.0.1.66 or later
' OR do not call Set x = Nothing until
' the last InLine in SessionProc or don't call Set x = Nothing at all which will be called internally for you at the end of the experiment
Set x = Nothing
End Sub
'EXAMPLE3: Using Dim in UserScript and then using Set = Nothing inside a function is OK
' so long as the reference count does not drop to zero.
'Psychology Software Tools has always discouraged using script to create objects.
' The following code placed in User script section of the experiment in E-Studio
Dim x As TextDisplay
Sub CreateText
If x Is Nothing Then Set x = New TextDisplay
End Sub
Sub DoSomething()
CreateText
Set y = x
y.Text = "Hello World"
y.Duration = 5000
y.Run
'The following line will decrement the internal reference count for the TextDisplay
' which will NOT destroy it since it was being reference twice ( 2 - 1 = 1 )
Set y = Nothing
End Sub
Solution
Update to E-Prime 2.0 (2.0.1.66) or later.
Workaround
This workaround is intended only for those who are unable to update to the version of E-Prime that contains the bug fix:
Use the E-Studio GUI to create objects in the interface. If objects must be created in script, then the objects must be created with the Dim keyword in User script section and then the Set = Nothing must not be assigned until the end of the experiment. Use of the Dim and New keywords together inside a function to declare the objects will cause the objects to be destroyed at the end of the function call causing this problem to occur.
Comments
0 comments
Please sign in to leave a comment.