User`s guide
E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 132
For example, if an attribute is defined at the block level, this attribute will be available at the block
level and all levels subordinate to the block level (e.g., trial, sub-trial, etc.). When values are
requested, the current level is searched first, and the search continues upward through the levels
until a value is found or until all levels have been exhausted. This defines a hierarchy of context
levels within the overall Context. If a value for an attribute is requested during a trial, E-Run will
search the trial level context first, then the next level of context (e.g., block level), and so on, to
resolve the value for the attribute.
For example, perhaps a series of blocks of trials is to be run, with the instructions for a series of
trials changing only when the next block is run. An attribute named “Instructions
likely be created at the block level, since the value of the Instructions attribute would only need to
vary from block to block. However, perhaps the instructions are to be displayed at the beginning
of each trial as a reminder of the task. A display during the trial Procedure would necessarily
reference the Instructions attribute (i.e., [Instructions]), which is defined at the block level. E-Run
would first check the trial level context, then the block level context, and then the session level
context in order to resolve the value of Instructions. In this example, the search would terminate
at the block level, where the Instructions attribute is defined.
4.3.1.1 Attributes
Data within the Context object is manipulated through the creation and setting of attributes.
Attributes differ from variables in that they generally define the experimental conditions and are
logged by default. The logging may be disabled for individual attributes.
Attributes must be entered into the Context of the experiment before they may be referenced or
modified. Although the Context object outlines the overall experiment, the Context is
hierarchically structured. Attributes defined at a specific level of the Context may be seen by any
level lower than the one at which the attribute is defined, and upper level information may be
inherited by lower level attributes. However, attributes defined at lower levels of the Context
cannot be "seen" beyond the level at which they are defined. Thus, in order to reference or
modify an attribute, it must be placed in the Context and set at the appropriate level.
4.3.2 Object.Properties
Properties are data items associated with objects that may be both retrieved and modified. For
example, the Stimulus object in the example above has properties that may be accessed and
modified through E-Basic script. Properties of an object are accessed using the dot operator,
which separates the property from the object with which it is associated. The example below
illustrates the assignment of the Text property associated with the Stimulus object. In this
example, the Text property is assigned a value of "X.”
Stimulus.Text = "X"
Not all properties may be modified. Read-only properties may not be modified through E-Basic
script. A listing of all properties associated with particular objects is available in the E-Basic
Online Help.
4.3.3 Object.Methods
Objects also have associated methods, which cause objects to perform certain actions. Like
properties, methods are accessed using the dot operator in conjunction with the object. Methods
may be broken down into Commands and Functions.