User`s guide

E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 152
'Collect response from AskBox
Dim strAnswer As String
strAnswer = AskBox ("Type in the recalled word:")
RecallStim.RESP = strAnswer
RecallStim.CRESP = c.GetAttrib("CorrectAnswer")
4.5.3.6 Example 6: Using Attribute References to Pass
Information
Attributes allow the passing of variable information during a Procedure. For example, in order to
vary the stimulus presented per trial, the stimulus values (e.g., text, name of the picture file, name
of the audio file) would be entered as separate exemplars for an attribute (e.g., Stimulus) on a
List object. In order to obtain the value of a specific exemplar within the Stimulus attribute listing,
the c.GetAttrib command is used. In the example below, a basic Stroop task is presented in
which the display color of the word varies per trial. The valid display colors (Red, Green, Blue)
are entered as RGB values in the "Ink" attribute on a List object.
Then, an InLine object is created to retrieve this information, and is inserted on the Trial
Procedure. The InLine object uses the c.GetAttrib command to retrieve the value of "Ink,”
and assign that value to the ForeColor property for the Stimulus TextDisplay object.
Stimulus.ForeColor = CColor(c.GetAttrib("Ink"))
The result is the variation of the display color of the stimulus per trial based on the values in the
Ink attribute.