User`s guide
E-Prime User’s Guide
Chapter 4: Using E-Basic
Page 153
4.5.4 Additional Information
For more details concerning E-Basic, refer to Chapter 2-E-Basic in the E-Prime Reference Guide.
The complete E-Basic scripting language is fully documented in the E-Basic Online Help. This is
accessible via the E-Studio Help menu, or in the E-Prime menu.
4.6 Programming: Intermediate
4.6.1 More on Variables
There is much more information pertaining to variables that should be learned. Rather than
overwhelm the beginning programmer, the information will be presented in stages of complexity.
Intermediate programmers will need to use variables on a frequent basis. The following section
details more information on declaration of, and working with variables.
4.6.1.1 DataTypes
When using the Dim statement to declare a variable, more information is required than just the
name. The type of data the variable can hold must be specified. The script below not only
reserves the word "subject_dob" as a variable, it also indicates that the variable is to hold a date
(i.e., the subject’s date of birth).
Dim subject_dob As Date
There are a variety of data types available within E-Basic. The following table illustrates the type
and an explanation of the type:
Data Type Description
Boolean True (-1) or False (0) value.
Integer Whole number ranging from –32767 to 32767
Long Whole number ranging from –2,147,483,648 to 2,147,483,647
Single Used to declare variables capable of holding real numbers with up to seven digits of
precision:
Negative: -3.402823E38 to -1.401298E-45, Positive: 1.401298E-45 to 3.402823E38
Double Used to declare variables capable of holding real numbers with 15–16 digits of precision:
Negative: –1.797693134862315E308 to –4.94066E-324, Positive: 4.94066E-324 to
1.797693134862315E308
Currency Used to declare variables capable of holding fixed-point numbers with 15 digits to the left
of the decimal point and 4 digits to the right (-922,337,203,685,477.5808 to
922,337,203,685,477.5807)
Date Used to hold date and time values.
Object Used to declare variables that reference objects within an application using OLE
Automation.
String Used to hold sequences of characters, each character having a value between 0 and
255. Strings can be any length up to a maximum length of 32767 characters.
Variant Used to declare variables that can hold one of many different types of data. Refer to the
Variant data type topic in the E-Basic Online Help.
User-Defined Requires the Type statement.
Conversion between data types
Once a variable has been declared as a certain data type, it may hold only information of that
type. E-Basic does not automatically convert data to the appropriate type. At times, it may be