random number

D

dave

Hello all,
I have written one function to generate random number.
but every time I execute the function it repeats same
number many times even though I'm using Randomize.

function myrandnum()
upperbound = 32767
lowerbound = -32768
Randomize
myrandnum = Int((upperbound - lowerbound + 1) *
Rnd + lowerbound)
end function

its not as good as effective as

set objTools=server.CreateObject("MSWC.Tools")
objTools.Random()

Any help would be appreciated...
Rgds
dave
 
B

Bob Milutinovic

G'day, Dave...

A wise man once said, "the generation of random numbers is too important
to be left to chance."

Replace the generic "Randomize" statement with;

Randomize Timer

- Bob.
 
D

dave

Thanx Bob..It worked good
-----Original Message-----
G'day, Dave...

A wise man once said, "the generation of random numbers is too important
to be left to chance."

Replace the generic "Randomize" statement with;

Randomize Timer

- Bob.





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top