Group: Administrators
Posts: 13K,
Visits: 104K
|
> ie. this will NOT work:
> / ontrialend = [ > if (correct==1) {values.response = 1} > else {values.response = 2} > > if (latency > values.resp_window) {values.inwindow = 0;} > else {values.inwindow = 1;} > ]
The above doesn't work because the statements aren't properly separated, i.e., the syntax is wrong. Do
/ ontrialend = [ if (correct==1) {values.response = 1} else {values.response = 2} ; <-Semicolon is the separator
if (latency > values.resp_window) {values.inwindow = 0;} else {values.inwindow = 1;} ]
and it should work just fine.
See for yourself by running
<block myblock> / trials = [1=mytrial] </block>
<trial mytrial> / ontrialend = [if (values.a) {values.response = 1} else {values.response = 2}; if (values.b > values.c) {values.inwindow = 0;} else {values.inwindow = 1;} ] / validresponse = (57) </trial>
<values> / a = false / b = 3 / c = 4 / response = 0 / inwindow = -1 </values>
<data> / columns = [values.a, values.b, values.c, values.response, values.inwindow] / separatefiles = true </data>
which has the same structure as your logic.
|