Group: Administrators
Posts: 13K,
Visits: 103K
|
The expressions parser doesn't particularly like nested conditionals along those lines, yes. It will fail to fully parse the expression when stated as you did and will not ever "see" the relevant else. You can force the parser into submission by restating to e.g.
<values> / r = -1 / g = -1 / b = -1 / c = false </values>
<trial set1> / ontrialbegin = [if(false) {values.r = 0; values.g = 0; values.b = 255} else {values.r = 0; values.g = 255; values.b = 0}; ] / ontrialend = [values.r = 0; values.g = 0; values.b = 0] / stimulusframes = [1=mytext] / validresponse = (57) </trial>
<trial set2> / ontrialbegin = [if(false) {if(true){values.r=0; values.g=0; values.b=255} else 0;} else {values.r = 0; values.g = 255; values.b = 0}; ] / ontrialend = [values.r = 0; values.g = 0; values.b = 0] / stimulusframes = [1=mytext] / validresponse = (57) </trial>
<text mytext> / items = ("R=<%values.r%>|G=<%values.g%>|B=<%values.b%>") </text>
<block myblock> / trials = [1=set1; 2=set2] </block>
In most cases, though, I would argue that there's a different and perhaps "better" way to express whatever you want to do (e.g. using if - else if - else constructs or collapsing the conditionals). Hope this helps.
|