Hey guys, I've been having a bit of a problem using the while function.
Here is my code (Simplified):
Dim RandomNumber3 As Random Dim RandomOutput3 As Integer RandomNumber3 = New Random() RandomOutput3 = RandomNumber3.Next(1, 9) Dim RandomClass As Random RandomClass = New Random() While (RandomOutput3 = RandomOutput Or RandomOutput2) RandomOutput3 = RandomClass.Next(1, 9) End While
When running the debug, the program crashes, and when I step into the program, I find that this While statement becomes an infinite loop. This is a program that uses random number generators to assign a value to something, and this while statement is necessary so that there is never two of the same values showing (RandomOutput, RandomOutput2 & RandomOutput) Have to be different to one another.
If you need any more details, If requested I can attach my program.
Edited 4 Years Ago by Tobyjug2222: n/a