Re: item random() (was Random(3) often returns 1)

2006-06-09 Thread Rob Cozens
Geoff, et al: Even stranger, making this slight adjustment fixes it: on mouseUp repeat 1000 put random(3) into z add 1 to x[z] There is something problematic involved in referencing a function result as a variable inline in a statement. I have encountered instances in other

Re: item random() (was Random(3) often returns 1)

2006-06-09 Thread Rob Cozens
Moi: add 1 to x[value(random(3)) Forgot trailing ] add 1 to x[(value(random(3))) Forgot trailing ] add 1 to item (random(3)) of myCounter] There it iswhere it shouldn't be. :{`) Rob Cozens CCW, Serendipity Software Company And I,

item random() (was Random(3) often returns 1)

2006-06-08 Thread Dar Scott
On Jun 8, 2006, at 11:05 AM, Mark Smith wrote: 341,344,345 1030 328,326,329 983 348,346,347 1041 331,334,335 1000 321,323,322 966 337,340,339 1016 317,318,316 951 310,308,309 927 345,345,346 1036 352,355,350 1057 not at all as expected My variation: on mouseUp set the cursor to watch

Re: item random() (was Random(3) often returns 1)

2006-06-08 Thread Mark Schonewille
Hi Dar, Rev 2.7.2 gives exactly the same results. Best, Mark -- Economy-x-Talk Consultancy and Software Engineering http://economy-x-talk.com http://www.salery.biz Download ErrorLib at http://economy-x-talk.com/developers.html and get full control of error handling in Revolution. Op

Re: item random() (was Random(3) often returns 1)

2006-06-08 Thread Geoff Canyon
I just ran this code on mouseUp repeat 1000 add 1 to x[random(3)] end repeat put sum(x) into y combine x using cr and tab put x cr cr y end mouseUp and got this: 1 329 2 328 3 328 985 Note that the three numbers don't add up to 1000, but there are no

Re: item random() (was Random(3) often returns 1)

2006-06-08 Thread Mark Schonewille
Hi Geoff, Funny, that's exactly what I demonstrated in a previous e-mail, earlier to/yesterday. Apparently, there is more than one workaround. Maybe a slight pause is all it takes. Best, Mark -- Economy-x-Talk Consultancy and Software Engineering http://economy-x-talk.com

Re: item random() (was Random(3) often returns 1)

2006-06-08 Thread Geoff Canyon
On Jun 8, 2006, at 4:59 PM, Mark Schonewille wrote: Funny, that's exactly what I demonstrated in a previous e-mail, earlier to/yesterday. Apparently, there is more than one workaround. Maybe a slight pause is all it takes. Looking back I see that -- apparently I didn't read the previous

Re: item random() (was Random(3) often returns 1)

2006-06-08 Thread Mark Smith
I tried putting a 'wait 1 millsecond' into the loop, and it made no difference. Perhaps there is something weird about what the random() function returns, until it is put into a variable? Mark On 9 Jun 2006, at 00:59, Mark Schonewille wrote: Maybe a slight pause is all it takes.