Select one of x text displays to show

Rob Manchester robmanc2014 at gmail.com
Sun Sep 28 16:54:59 UTC 2014


Hi

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 ‘text display’ 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 ‘text displays’ 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 ‘(infinite)’ 
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/ecf84a87-48fd-43e3-afd7-7e9fd0ab4abf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140928/332786ec/attachment.htm>


More information about the Eprime mailing list