User`s guide
E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 124
addition to sections for intermediate and advanced users. The goal of this chapter is to get the
user accustomed to writing E-Basic script. If this is something that is believed to be beyond
present abilities, the following section will recommend some additional sources.
4.1.1 Before Beginning…
Before attempting to write any script using E-Basic, a few critical pieces of information must be
known. It is recommended that even the most expert programmer read the following
section.
Learning to write script will minimally require learning the basics of programming. The complexity
of the task will determine the amount and complexity of the script required, and therefore, the
amount and complexity of script-writing knowledge necessary. Most experiments involving user-
written script will minimally require the user to be able to write and add functions (e.g., to display
an internal variable, or indicate contingent branching based on responses). For someone with
programming experience, these types of functions might be accomplished in a few minutes or
hours, while someone without programming experience may need a day or more to accomplish
the same goal. More complicated tasks, such as creating a simulated ATM machine, will require
more comprehensive programming and may require considerable programming experience.
Again, the length of time required to accomplish the task will depend on programming knowledge,
skill, and the task itself. Complex systems interactions, such as creating new SDKs, would
require significant programming knowledge and expertise, and are best handled by professional
programmers.
The present chapter discusses the E-Basic language and the basics of entering user-written
script. If the reader has experience programming with languages such as Basic, C, Pascal, or
experience writing MEL Professional code subroutines, the information in this chapter should be
straightforward. New users to programming are advised to become familiar with script by taking a
programming course, or by carefully working through script examples. E-Basic is very similar to
Visual Basic for Applications. Visual Basic for Applications would be the best programming
course to choose. Visual Basic would also be useful, and the knowledge would transfer well.
If there is a preference to learn about programming alone, or for more help, PST recommends the
following reference sources:
For the novice user who has little to no programming experience and for those new to VBA type
languages:
VBA for Dummies, Steve Cummings, IDG Books Worldwide, Inc., Foster City, CA, 1998.
For more advanced users with substantial programming experience:
VBA Developer's Handbook, Ken Getz & Mike Gilbert, Sybex Inc., San Francisco, CA, 1997
Another efficient method of learning to program using E-Basic is to examine script examples in
the E-Basic Online Help and actual programs generated by E-Studio. The E-Basic Online Help
may be launched from the Start button, or through the Help menu in E-Studio.
It can be very useful to view the script automatically generated by E-Studio in an EBS (E-Basic
Script) file. When an experiment is compiled within E-Studio using the Generate command in the
E-Run menu, or the Generate tool button, E-Studio automatically generates the script for the E-
Objects defined in the ES (Experiment Specification) file into the EBS file. Examination of the
EBS file can provide a great amount of information concerning the properties associated with an
object, or the methods used to manipulate data related to that object. An EBS file may be