User`s guide

E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 135
4.4 Basic Steps for Writing E-Prime Script
The following steps, to be covered in this section, introduce helpful information for writing E-Basic
script or accessing values determined through script.
1. Determine the purpose and placement of the script
2. Create an InLine object and enter the script
3. Determine the scope of variables and attributes
4. Set or reference values in script
5. Reference script results from other objects
6. Debug
7. Test
The basic steps refer specifically to writing script in an E-Prime experiment. For additional
information, it is recommended that the user continue in the current chapter, working through the
Programming sections.
4.4.1 Determine the purpose and placement of the
script
This step requires the user to consider what task the script is supposed to accomplish and when
the action must occur. For example, an experimenter might want to choose a random number
from 1-499 to be used as the stimulus display for each trial. The purpose of the script, therefore,
is to select a random number and to place the selected value into a form useable by E-Prime.
The placement of the script must be within the Procedure driving the events of the trial.
Specifically, since the random number is to be used during the display of the stimulus, the script
determining the value must be entered in the trial Procedure prior to the object displaying the
stimulus.
4.4.2 Create an InLine object and enter the script
Once the appropriate placement of the script has been determined, create an InLine object at that
location. Continuing the example from Step 1, if the script is to determine a random number
during the trial Procedure (TrialProc) prior to the stimulus display, the most appropriate location
for the InLine object containing this script is as the first event in the TrialProc.
Actually, any time prior to the event displaying the stimulus would be appropriate, but it is good
practice to separate the setup events from the critical events of the trial (e.g., Fixation-Stimulus-
Feedback).