July 28th, 2003, 08:40 PM
random function in VB
I am developing a project in VB and I thought it would be nice idea to have some sort of animation which would poke out from everwhere RANDOMLY.
I am looking for a function like the one in C++ that's called rand()
July 28th, 2003, 09:14 PM
xtremebuster you can do something like the following to create your random numbers.
Dim theRandomNumber 'declare theRandomNumber
Randomize 'needed to creat the random number
theRandomNumber = Int((8 * Rnd) + 1) 'creates a random integer between 1 to 8
Note that Rnd does the randomizing. I hope that helps.
P.S- Your post is in the wrong forum.
- The mind is too beautiful to waste...
July 28th, 2003, 10:24 PM
July 29th, 2003, 11:55 AM
i like to use the timer for the "Randomize" seed...
maybe use a timer control, set the timer duration to a random number + 5000...
yeah, I\'m gonna need that by friday...
July 29th, 2003, 06:49 PM
Thanx Cutty and tampabay420.
I'll be giving a try to both the methods explained.
July 30th, 2003, 01:10 AM
err...you also have to think about what the user would like. I certainly wouldnt like some bunny hopping randomly over my text while i am trying to type in values. Anyways, if you are the user, then do whatever you want, but if this is for a job, your boss will be mad
I thought it would be nice idea to have some sort of animation which would poke out from everwhere RANDOMLY
Support your right to arm bears.
^^This was the first video game which i played on an old win3.1 box