Rick,
>Avoids the repeat loop and potential problems there.
For one-stop shopping for random numbers:
put random(gUpper-gLower) + gLower into MCH
Nelson
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug report
Hi Rick. Sounds like you are using an older version of MC tools stack.
Just update to the current one 2.3 or 2.3.1 b2 and that problem will go
away.
-Mark Talluto
KIDware Technologies
www.kidwaretech.com
> From: [EMAIL PROTECTED]
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 6 Jun 2000 23:11:00 -
Sorry, meant to post that last message to Steven.
As an aside, can anyone explain why on windows when I get a divide by
zero error when I open the script editor the involved line is not in
fact displayed. The cursor is flashing at whatever line I last edited.
The message says the error is
Steven:
Thanks for the suggestion. You were correct. The divide by zero error
was not in the random number generation but was in fact in a later
handler where in fact division does occur.
I must say that I like your random generator much better than mine.
Avoids the repeat loop and
Rick,
>When I run it on
>the Windows platform I preiodically get a divide by zero error
Try the following:
on generateMCH
global MCH, glower, gupper
if gUpper>1 and gLower>0 and gUpper>gLower then
put empty into MCH
repeat until MCH >glower
put random(gupper) into MCH
EdTech wrote:
> I have the following script to generate a random number between upper
> and lower limits.
[snip]
> on generateMCH
> global MCH, glower, gupper
> put empty into MCH
> repeat until MCH >glower
> put random(gupper) into MCH -- this is the line that
>