Is an If...then... by cycle possible?

David McFarlane mcfarla9 at msu.edu
Mon Feb 9 13:29:19 UTC 2009


Rivermaker (i.e., Michael),

> I don' t have much programming experience,

E-Prime is a great system for using existing programming skills to build 
programs for psychology experiments, but it is a lousy system for first 
learning how to program.  For that I recommend taking a regular course
in any established object-oriented computer language such as 
VisualBasic, Python, JavaScript, or C++.  But enough editorial, on to 
your question (which was very nicely laid out)...

> Basically, I want to show the participant text that informs them to
> which set of stim presentations they're about to be exposed. I was
> thinking that there must be a way to build an InLine script that
> attached the current cycle count from a particular list object to text
> string.
> 
> For example, following each set of stim presentations, I could imagine
> something like :
> 
> If (on cycle 1) then text reads "Get ready for set 2!"
> If (on cycle 2) then text reads "Get ready for set 3!"
> .
> .
> .
> If (on cycle 10) then text reads "You're finished!"
> 
> 
> 
> Is there a way to do this?

Perhaps.  As you have noticed, your E-DataAid files have a column or 
"attribute" showing a cycle count for each List, e.g., 
"TrialList.Cycle".  Naturally, you want to know if you can use this 
attribute within your program.  Well, like most any E-Prime attribute, 
the list cycle count is available through the GetAttrib method of the 
Context object (see the online E-Basic Help for details), e.g.,

If c.GetAttrib("TrialList.Cycle") Then ...

But I have not explored this very far, and the cycle attribute for your 
list may not be available at every phase of your program.  So...

> If you can't do this with the cycle count,
> is there a way to set up a variable to use for this instead?

Even if you can do this with the cycle count, doing it with a variable 
may offer some advantages.  I cannot show you the entire way, but first 
you need to set up a global variable.  To learn how to do that please 
work through the "Using E-Basic" chapter of the User's Guide that came 
with E-Prime, especially 4.3.4 ff.  You should be able to take it from 
there.

-- David McFarlane, Professional Faultfinder


--~--~---------~--~----~------------~-------~--~----~
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