Using rand(x,y) in expressions


Author
Message
AKrishna
AKrishna
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 120, Visits: 410
Hi,

just a quick question: if I set up an expression that includes a rand(x,y) function, will the random number be picked once or will it be repicked every time the expression is called? So for example:

<expressions>
/ MyExpression = 100 + rand(-50,50)
</expressions>

<trial Tester>
/ stimulustimes = [0 = TestText]
/ validresponse = (" ")
</trial>

<text TestText>
/ items = ("Showing number <%expressions.MyExpression%>")
</text>

If trial.Tester is repeated, will there be different values for MyExpression shown? If not, are there any circumstances that might cause the expression to draw a new random number? I'm asking because the closest analogues, new elements from lists, appear to be accessed only when called via a reference to list.MyList.nextitem in an ontrialbegin/ontrialend/branch, not when referenced in a text object using <%list.MyList.nextitem%> - or at least that was my understanding.

Thanks for any help!




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search