Millisecond Forums

Random function returns different results in 3.0.6 versus 3.0.4

By robgommans - 1/24/2012


Does somebody know why the following line of code returns a different, incorrect number in version 3.0.6, while returning a correct number in version 3.0.4?


In v3.0.4., it returns a number between 30 and 40. In v3.0.6, it returns -43545435353455 of something like that. In other words, an incorrect number. Should I initialize something first in v3.0.6, before using the random function?


By Dave - 1/25/2012


/ myexpression = rand(30,40)

<text mytext>
/ items = ("<%expressions.myexpression%>")

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (anyresponse)

<block myblock>
/ trials = [1-4=mytrial]

works perfectly fine for me under You should check whether you're running the very latest build (Dec 19) and/or provide proper context re. your particular use case.



By robgommans - 1/25/2012

Hi Dave,

Thanks for your reply. 

It must have been the build of v3.0.6. I tested my code on a different computer and the problem occurred. Since v3.0.6 was installed on this computer (rather than 3.0.4), I installed v3.0.4. and tested the code again. Now, the problem didn't occur. That is why I first thought it had something to do with the new version. I downloaded v3.0.6. again, re-installed it, and now it works fine. Unfortunately, I don't know the build of the previous v3.0.6 installed on this computer.