Hello,
I'm having trouble using the Random class. I have this code here:
Dim myRandNum As Random = New Random(DateTime.Now.Millisecond)
Dim i As Integer = 0
i = Integer.Parse(myRandNum.Next(0, 21))
I have this code in a function and everytime I call it it return a random number. The problem is I only want the number to be return/generate once. There be times I call the function and it returns the same number as in the pass. Is there a way to random the number once? I know in C++ you use like "Seed" or something and it will only generate once. Please help, Thanks!
I'm having trouble using the Random class. I have this code here:
Dim myRandNum As Random = New Random(DateTime.Now.Millisecond)
Dim i As Integer = 0
i = Integer.Parse(myRandNum.Next(0, 21))
I have this code in a function and everytime I call it it return a random number. The problem is I only want the number to be return/generate once. There be times I call the function and it returns the same number as in the pass. Is there a way to random the number once? I know in C++ you use like "Seed" or something and it will only generate once. Please help, Thanks!