Problem getting If statement to work properly


Author
Message
DCole9
DCole9
Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)Distinguished Member (4.4K reputation)
Group: Forum Members
Posts: 42, Visits: 220
I'm having a problem getting the following if statement to change a value correctly.  I want to check the random position variable, the last trial's response, and the random demand variable to assign the location of the next stimulus.   All of the if statement conditions look correct in the log file but yet it does not pass as "true" and set the values accordingly.  
"/ontrialbegin = [if ((values.randomposition == 1) && (values.response == "patch1") && (values.randomdemand == "lowpatch1" )) {values.lownumbery = 40%; values.highnumbery = 60%}]"


Additionally I'm having  similar problem but using an if statement to insert stimulus frames.  An example is-
/ontrialbegin = [if ((values.randomposition == 1) && (values.response == patch2) && (values.randomdemand == "lowpatch1"))
{trial.patchtrial.setstimulusframe(focus, 1); trial.patchtrial.insertstimulusframe(choose, 1); trial.patchtrial.insertstimulusframe(highnumber, 1); trial.patchtrial.insertstimulusframe(blankpatch2, 1); trial.patchtrial.insertstimulusframe(patch1, 1); }]"

Attachments
DemandSelection.iqx (242 views, 31.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search