User`s guide

E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 141
Debug.Print may also be used to monitor timing and response events. The following script uses
Debug.Print to write the stimulus onset time and the subject’s response to the Output window.
The contents of the Debug tab may be copied to the clipboard by right clicking in the Output
window. Then, the Debug output may be pasted into Excel to print it or use spreadsheet
calculations to check the timing of events.
The Debug object is most appropriate during the development and testing of new programs.
After an experiment has been fully tested, the Debug commands may be disabled by setting the
Debug object’s Enabled property to "false" (i.e., Debug.Enabled = false). This allows the user to
leave Debug commands in the script for future testing purposes, but to improve the efficiency of
the program during data collection.
A final method of debugging involves the use of comments to indicate the purpose of certain
sections of script. This method may be employed more often as a preventative measure than as
a diagnostic tool, but can be of tremendous importance during debugging (especially if someone
other than the author of the script is given the task of debugging). There is no standard style for
adding comments, but in general they should be brief descriptions of the purpose of the segment
of script. Many of the script examples used in this chapter make use of brief comments to
summarize the purpose of the script for the reader. In E-Basic, comments are separated from
script that is compiled through the use of the apostrophe (‘) keyword or the Rem statement.
Refer to the Comments topic in the E-Basic Online Help within E-Prime for further discussion of
comments.