Help with E-Basic Mouse-Capture Loop

David McFarlane mcfarla9 at msu.edu
Mon Dec 13 21:19:59 UTC 2010


Tyler,

>Second, is it possible for the E-Basic code to "know" (or read-in) the
>name of the Procedure it is running? In the code I am working with I
>need to make 100+ procedures and adapt the code for each (changing,
>for example, F1AStimulus to F1DStimulus), but it would save me
>countless hours if I could read in this value. Is this possible?

Indeed, c.GetAttrib("Procedure") will return a string with the name 
of the current running Procedure (unless it is SessionProc, in which 
case you get a run-time error).  In addition, you can use 
Rte.GetObject to retrieve any E-Object by name.  Please see the 
appropriate topics in the online E-Basic Help.

But this seems a very poor way to get your work done.  I don't know 
enough about your particular experimental task to see why you need 
100+ Procedures, nor do I want to know that much.  But I have vast 
experience with EP and other platforms, and I cannot think of a time 
when some user's large & complex program did not result simply from 
their poor structure (<rant> which in turn results from a perverse 
refusal of users to get even the most rudimentary formal training in 
computer programming </rant>).  Time and again users have come to me 
with a program where they used a different Procedure for any time 
they wanted to use a different stimulus content, instead of simply 
changing the stimulus content by using an attribute (from a List or 
from code), as is shown in Tutorial 1 of the Getting Started 
Guide.  This recurring mistake completely violates the very purpose 
of a tool like E-Prime, it would be like turning a power drill by 
hand.  On several occasions I have taken some program from a user and 
reduced it down to a single Procedure that covered all the 
situtations, controlling contest with attributes, which made the 
program much more manageable and understandable.

So I suspect that your 100+ Procedures problem has more to do with 
not completely working out the task structure, and rather than adding 
more complexity in order to get around this, I would implore you to 
fix the underlying structure.  That will pay much bigger dividends.

-- David McFarlane, Professional Faultfinder
"When all is said and told, the 'naturalness' with which we use our 
native tongues boils down to the ease with which we can use them for 
making statements the nonsense of which is not obvious."  -- Edsger 
W. Dijkstra, "On the foolishness of 'natural language programming'" 
(http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD667.html)

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list