Select one of x text displays to show

David McFarlane mcfarla9 at msu.edu
Mon Sep 29 18:44:41 UTC 2014


Rob,

Not sure I fully understand what you are up to 
here.  But here are couple of ways to pick one level from a List.

1) Set the Order of the List to Counterbalance -- 
see 
https://groups.google.com/d/topic/e-prime/JtLh6DxqCbs 
for discussion.  Note that the E-Studio GUI 
allows Counterbalancing only by Subject, Session, 
or Group, but see 
https://groups.google.com/d/topic/e-prime/CHntiIUbUmc 
for how to use inline code to counterbalance by other attributes.

2) Use List.GetAttrib directly -- see the 
"Factor.GetAttrib" topic in the E-Basic Help facility.

BTW, for anyone who does find a need to 
manipulate List Weights at runtime, please see 
discussion at https://groups.google.com/d/topic/e-prime/FZ8FkYs3o2U .

Also, if you really do need to "run" a stimulus 
without it doing anything (as opposed to simply 
bypassing it with a Goto and Label), then you 
might accomplish that by setting Duration to 0 
*and* setting OnsetSync to "(none)".  See the 
"RteRunnableInputObject.OnsetSync" topic in the 
E-Basic Help facility, and review the Critical 
Timing chapter in the User's Guide that came with E-Prime.

As for setting an "infinite" Duration in code -- 
you could figure that out yourself just by 
setting some Duration to "(infinite)" and then 
looking at the generated code (that's how I 
figure out a lot of this stuff).  If you do that, 
you should find that "(infinite)" translates 
simply to a Long value of -1 (negative one) in 
code, e.g., StimText.Duration = -1 means an 
infinite Duration.  (To be fair, I know this 
factoid because EP1.0 explicitly used -1 for 
infinite in the GUI, we did not get an 
"(infinite)" option way back then.  Sometimes 
making things more convenient also makes things harder.)

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder:  1) I do not work for PST.  2) 
You may reach PST's trained staff (and other 
support facilities) at https://support.pstnet.com 
.  3) If you do get an answer from PST staff, 
please extend the courtesy of posting their reply 
back here for the sake of others.
\----


At 9/28/2014 12:54 PM Sunday, Rob Manchester wrote:
>Question about coding 'best practice' here. I 
>need to insert something into an E-Prime program 
>whereby depending on a variable value 
>(iBlockCount) the screen should display one 
>particular â EURO ~text displayâ EURO (tm) from a set of text 
>displays. The particular text display I want to 
>show varies depending on the value of the 
>variable (the displays relate to the message 
>shown at the start of a 'block' of trials in an experimental paradigm'.
>
>To achieve this I've created a List item with 
>procedures listed within in it,and then put each 
>â EURO ~text displaysâ EURO (tm) in its own individual 
>procedure within the list item. I thought I 
>could then get the code to dynamically  select 
>which level of the list item (and therefore 
>which procedure and text display) to run, based 
>on the variable value. I first tried to do this 
>by setting the 'weight' of the list levels 
>dynamically, so that only the one I want to show 
>has a weight>0. With the list item set to run 
>one repetition sequentially I thought this would 
>just show the required text display and no 
>others. However this failed to not show the text 
>displays in levels with weight=0 (the code used 
>is commented-out of the code below).
>
>What I've done instead is to alter the duration 
>of the text displays so that the ones I don't 
>want to show are set to duration=0 (code below). 
>However this seems pretty clunky, and I get 
>flickers where presumably the duration=0 text 
>displays are showing for 1 refresh. Is there a 
>better way of selecting 1 of x text displays to show?
>
>On a separate point, is there a way of setting 
>the duration to â EURO ~(infinite)â EURO (tm) using the code. 
>I couldn't get E-prime basic to recognise either 
>'(infinite)' of just 'infinite' as valid values, 
>so I've had to use duration=1000000 as a proxy.
>
>Thanks
>Rob
>
>If iBlockCount = 1 Then
>'set weights doesn't seem to work, so set duration instead
>   'StartScreen.SetWeight 1, 1
>   'StartScreen.SetWeight 2, 0
>   pressToStart.duration=1000000
>   pressToContinue.duration=0
>Else
>   'StartScreen.SetWeight 1, 0
>   'StartScreen.SetWeight 2, 1
>       pressToStart.duration=0
>       pressToContinue.duration=1000000
>       debug.print pressToContinue.duration
>End If

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/5429a8a0.3431320a.3aa6.42a0SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.



More information about the Eprime mailing list