Hey, I need the simple Random function.
Can ne post it for me?
tnx
Printable View
Hey, I need the simple Random function.
Can ne post it for me?
tnx
MSDN :
To produce random integers in a given range, use this formula:
Here, upperbound is the highest number in the range, and lowerbound is the lowest number in the range.Code:Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
something like that ?
To get you started:
VB Code:
Private Function Random(ByVal Min As integer, ByVal Max As integer) As Integer Randomize Random = Int((max - min + 1) * Rnd + min) End Function
No, I mean something like get a random number between 1 to 10...
?
Randomize
int((10-1+1)*rnd+1)
VB Code:
Private Sub Command1_Click() Randomize Timer Msgbox Int((Rnd * 10) + 1) End Sub