<div dir="ltr">Hi<br><br>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'.<br><br>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). <br><br>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? <br><br>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.
<div> </div>
<div>Thanks<br>Rob<br><br></div>
<div><span style="font-size:10.0pt;color:blue">If</span><span style="font-size:10.0pt;color:black"> iBlockCount =
</span><span style="font-size:10.0pt;color:purple">1</span><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:blue">Then</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:green">'set weights doesn't seem to work, so set duration instead</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:green">'StartScreen.SetWeight 1, 1</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:green">'StartScreen.SetWeight 2, 0
</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black"> pressToStart.duration=</span><span style="font-size:10.0pt;color:purple">100000<wbr>0</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black"> pressToContinue.duration=</span><span style="font-size:10.0pt;color:purple">0</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:blue">Else</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:green">'StartScreen.SetWeight 1, 0</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:green">'StartScreen.SetWeight 2, 1</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black"> pressToStart.duration=</span><span style="font-size:10.0pt;color:purple">0</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black"> pressToContinue.duration=</span><span style="font-size:10.0pt;color:purple">10000<wbr>00</span><span style="font-size:10.0pt;color:black"></span></div>
<div><span style="font-size:10.0pt;color:black"> debug.print pressToContinue.duration</span></div>
<div><span style="font-size:10.0pt;color:blue">End</span><span style="font-size:10.0pt;color:black">
</span><span style="font-size:10.0pt;color:blue">If</span></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:e-prime+unsubscribe@googlegroups.com">e-prime+unsubscribe@googlegroups.com</a>.<br />
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/ecf84a87-48fd-43e3-afd7-7e9fd0ab4abf%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/e-prime/ecf84a87-48fd-43e3-afd7-7e9fd0ab4abf%40googlegroups.com</a>.<br />
For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br />