Clock.Scale? amazing. thank you, david!<br><br><div class="gmail_quote">On Tue, May 10, 2011 at 4:02 PM, David McFarlane <span dir="ltr"><<a href="mailto:mcfarla9@msu.edu">mcfarla9@msu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The question comes up from time to time, "How can I learn to program with E-Prime?" Here is my attempt to answer that.<br>
<br>
First, some earlier posted partial attempts to address this:<br>
<a href="http://support.pstnet.com/forum/Topic1806-5-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic1806-5-1.aspx</a><br>
<a href="http://support.pstnet.com/forum/Topic2316-5-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic2316-5-1.aspx</a><br>
<a href="http://support.pstnet.com/forum/Topic2951-12-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic2951-12-1.aspx</a><br>
<a href="http://support.pstnet.com/forum/Topic2446-23-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic2446-23-1.aspx</a><br>
<a href="http://groups.google.com/group/e-prime/browse_thread/thread/e4b89ad5265c747a/b1ec5d104cc7977d" target="_blank">http://groups.google.com/group/e-prime/browse_thread/thread/e4b89ad5265c747a/b1ec5d104cc7977d</a><br>
( <a href="http://listserv.linguistlist.org/cgi-bin/wa?A2=ind0804D&L=EPRIME&P=R1715" target="_blank">http://listserv.linguistlist.org/cgi-bin/wa?A2=ind0804D&L=EPRIME&P=R1715</a> )<br>
<br>
And now, my essay...<br>
<br>
For those without any programming background:<br>
- E-Prime is well suited for casual, amateur programmers of simple<br>
psychological experiments, insofar as it insulates the user from the<br>
deeper workings of the system (and encapsulates several structures and<br>
concepts peculiar to experimental psychology). As a result, it makes<br>
a poor platform for learning or understanding actual computer<br>
programming. If you try this you will only make things hard on<br>
yourself.<br>
- I urge you instead to just knuckle down and do some actual coursework<br>
in any modern object-oriented programming language until you at least<br>
grasp some general core concepts (bits, bytes, words, literals,<br>
constants, variables, integers, floats, strings, arrays, objects,<br>
representations, types, classes, scope, operators, labels,<br>
conditionals, branches, loops, blocks, subroutines, functions,<br>
arguments, etc.). Otherwise you will not understand what we are<br>
talking about.<br>
- Since E-Basic is a derived from Microsoft Visual Basic for<br>
Applicatons (the language element of Visual Basic 6), you would do<br>
best to study this if possible.<br>
- Some of us who hearken back to the 1980s still think that Pascal<br>
makes a fine language for learning general programming concepts,<br>
but it has fallen out of fashion. (And if you did study Pascal,<br>
you would want an object-oriented version, e.g., ObjectPascal.)<br>
- You can use any web browser (e.g., Internet Explorer, Firefox,<br>
Opera) to study JavaScript, which incorporates a rich set of<br>
object-oriented concepts, for free. However, JavaScript quickly<br>
gets entangled with HTML, Cascading Style Sheets, and the Document<br>
Object Model, so this may not be so useful as I once thought.<br>
- Python is also free, and seems to be generally in fashion now for<br>
Introduction to Programming, so you might try that.<br>
- Python does not let you learn directly about labels and goto<br>
statements, which you will need for E-Prime. But you might<br>
learn similar concepts with Python's exception handling<br>
(i.e., try, raise, except).<br>
- Personally, for this kind of work I think you cannot do better<br>
than to get a good grounding in C or C++, but I seem to be<br>
outvoted here.<br>
- Even more fundamental than learning any programming language, you<br>
should study and be comfortable with math in general, and in<br>
particular propositional logic, combinatorics, and probability.<br>
- It also helps to know some information and communication theory.<br>
(If you can make it through the classic work of Claude Shannon,<br>
then you are in good shape.)<br>
- See my "How to Solve E-Prime Puzzles".<br>
<br>
For those who come to E-Prime with some programming background:<br>
- E-Basic is a derived from Microsoft Visual Basic for Applications<br>
(the language element of Visual Basic 6). So you might like some<br>
materials on VB or VBA.<br>
- Most materials on Visual Basic focus on using the VB GUI to design<br>
the GUI aspects of your program, and using VB to control<br>
databases and web sites, so they are not much use to us.<br>
Instead, you want a source that covers the basic language<br>
elements.<br>
- Books to try:<br>
- "VBA for Dummies", Steve Cummings, IDG Books Worldwide, Inc.,<br>
Foster City, CA, 1998.<br>
- "VB and VBA in a Nutshell: The Language", Paul Lomax,<br>
O'Reilly Media, Inc., Sebastopol, CA, 1998.<br>
- "VBA Developer's Handbook", Ken Getz & Mike Gilbert, Sybex<br>
Inc., San Francisco, CA, 1997.<br>
- "VBA for Dummies" and "VBA Developer's Handbook" come<br>
recommended in the E-Prime User's Guide (p. 124, sec. 4.1.1).<br>
- I find "VBA for Dummies" to make the best general discursive<br>
introduction (despite its annoyingly chatty style). "VB and<br>
VBA in a Nutshell", true to O'Reilly's general quality, makes<br>
a generally good reference book. "VBA Developer's Handbook"<br>
is really meant for a different audience (developers of<br>
commercial VBA applications).<br>
- E-Basic lacks some standard VBA elements (e.g., With).<br>
- E-Basic extends VBA with its own host of classes/objects (and<br>
associated properties and methods), so VB books only help so far.<br>
- In addition, vital task control issues such as randomization and<br>
critical timing go beyond the scope of most programming texts, so<br>
you will have to learn those separately (e.g., Chapter 3 of the<br>
E-Prime User's Guide).<br>
- BTW, the E-Studio environment itself borrows a lot from the<br>
Visual Basic Editor.<br>
- Some features of E-Prime (e.g., graphics and timing) rely on<br>
Microsoft's DirectX technology, so you may wish to also study that.<br>
- The Guides supplied with E-Prime do a pretty good job as far as they<br>
go, but they are rather tutorial in nature and scope. There is<br>
neither a proper technical reference, nor any discursive guide to lay<br>
out the underlying principles and concepts of E-Prime and E-Basic.<br>
You are left to puzzle this out for yourself, or along with other<br>
regular users.<br>
- Make lots of small demo programs in E-Studio, and study the<br>
generated code.<br>
- Use Lists and Weights to easily limit test runs.<br>
- Use Clock.Scale for speeded test runs.<br>
- Log test values (c.SetAttrib) and examine the resulting<br>
.edat* file *after* test runs to see what the program did.<br>
- Or, use Debug.Print (per Michiel Spapé).<br>
- Or, use MsgBox to trace execution at run time.<br>
- Use GetUserBreakState() for graceful early exits.<br>
- If you have EP1, use E-Run to try out E-Basic elements with even<br>
simpler test programs. You can do this even without a hardware<br>
key (which is probably why PST removed this capability from E-Run<br>
in EP2). In this regard, EP2 makes an inferior platform for<br>
studying E-Basic.<br>
- See my "How to Solve E-Prime Puzzles".<br>
- In particular, study Chapter 4, "Using E-Basic", of the User's<br>
Guide.<br>
- If you care at all about critical timing, then someone in<br>
your lab *must* study Chapter 3 of the User's Guide. I<br>
cannot stress this enough.<br>
- The "real" documentation, insofar as we get any at all, is in<br>
the E-Basic Help facility.<br>
- The E-Basic Help facility is still incomplete (e.g.,<br>
<a href="http://support.pstnet.com/forum/Topic1241-12-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic1241-12-1.aspx</a> ), and<br>
in some cases misleading or just plain wrong (e.g.,<br>
<a href="http://support.pstnet.com/forum/Topic1197-5-1.aspx" target="_blank">http://support.pstnet.com/forum/Topic1197-5-1.aspx</a> ).<br>
<br>
-- David McFarlane, Professional Faultfinder<br><font color="#888888">
<br>
-- <br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com" target="_blank">e-prime@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com" target="_blank">e-prime+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href="http://groups.google.com/group/e-prime?hl=en" target="_blank">http://groups.google.com/group/e-prime?hl=en</a>.<br>
<br>
</font></blockquote></div><br>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com.<br />
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.<br />