RAN() misbehaving
#3
(07-06-2015, 01:43 PM)bbjimmy Wrote: I always use :
Code:
tmp=ran()
for f = 1 to 10
print ran()
next

Yes, I figured that out as well, but it does not fill me with confidence. Here are two more workarounds. 99% of the time, I convert the RAN output to integer anyway, so:

Code:
sub RandInt()
    //returns a random integer between 0 and 32767
    a = val(system$("echo $RANDOM"))
    return a
end sub

sub RandInt0To9()
    //returns a random integer between 0 and 9, inclusive
    a=val(mid$(time$, 8,1))
    return a
end sub
Reply


Messages In This Thread
RAN() misbehaving - by clasqm - 07-06-2015, 01:04 PM
RE: RAN() misbehaving - by bbjimmy - 07-06-2015, 01:43 PM
RE: RAN() misbehaving - by clasqm - 07-07-2015, 10:52 AM
RE: RAN() misbehaving - by bbjimmy - 07-08-2015, 03:03 PM
RE: RAN() misbehaving - by lorglas - 08-23-2015, 07:08 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)
Free Web Hosting