on-internet
← Community

Why do both of the random numbers I create be the same everytime in visual basic?

Stack Overflow ·

Why are RandomInt1 and RandomInt2 always the same number each time I run my code? Dim RandomGen1 As New Random Dim RandomInt1 As Integer RandomInt1 = RandomGen1.Next(2, 7) Dim RandomGen2 As New Random Dim RandomInt2 As Integer RandomInt2 = RandomGen2.Next(2, 7)

Comments

Sign in or sign up to comment and upvote.

No comments yet.