Random number generator

943 views
Skip to first unread message

c.wahlheim (Jacoby Lab @ Wash U)

unread,
Nov 3, 2007, 8:26:25 PM11/3/07
to E-Prime
Hi,
I am fairly new to ePrime and brand new to this group. I am trying to
program an experiment in which false feedback is given to incorrect
responses on a recognition memory test. Specifically, I would like
the false feedback "correct" to only be displayed 85% of the time that
an incorrect response is produced (e.g., false alarm, miss). I was
thinking that I could use a random number generator along with an "if"
command to do this. Does anyone know how to write the inline code for
a random number generator?
Thanks,
Chris

chen

unread,
Nov 3, 2007, 9:54:42 PM11/3/07
to e-p...@googlegroups.com
Syntax
Random(min,max)
Description
Returns a Long value greater than or equal to min and less than or equal to max.
Comments
Both the min and max parameters are rounded to Long. A runtime error is generated if min is greater than max.
Example
'This example uses the random number generator to generate ten
'lottery numbers.
Const crlf = Chr$(13) + Chr$(10)
Sub Main()
 Randomize      'Start with new random seed.
 For x = 1 To 10
  y = Random(0,100)  'Generate numbers.
  message = message & y & crlf
 Next x
 MsgBox "Ten numbers for the lottery: " & crlf & message
End Sub

--
Chunhui Chen
______________
 
Beijing Normal University
&
University of California, Irvine

快 抢 !网 易 邮 箱 积 分 100% 换 大 奖 ,过 时 不 候 !点 击 兑 换 >>
Reply all
Reply to author
Forward
0 new messages