07-07-2015, 10:52 AM
(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