New to VB. Any help is much appreciated. Is there a better way to do this?
-------------------------
cnt = 4
dim tryArray(4)
' First I pick 5 numbers
for x = 0 to cnt
Randomize
tryArray(x) = (Cint(((intCnt-1)-0+1) * Rnd+0)
Next
' Then I go through comparing each one to each other
' making sure they are all unique
For y = 0 to cnt
For z = 0 to cnt
' If one matches another, get another number and
' start the checks all over again
if tryArray = tryArray(z) AND y<>z then
Randomize
tryArray(z) = (Cint(((intCnt-1)-0+1) * Rnd+0)
y=-1
z=0
Exit For
End if
Next
Next
-------------------------
-------------------------
cnt = 4
dim tryArray(4)
' First I pick 5 numbers
for x = 0 to cnt
Randomize
tryArray(x) = (Cint(((intCnt-1)-0+1) * Rnd+0)
Next
' Then I go through comparing each one to each other
' making sure they are all unique
For y = 0 to cnt
For z = 0 to cnt
' If one matches another, get another number and
' start the checks all over again
if tryArray = tryArray(z) AND y<>z then
Randomize
tryArray(z) = (Cint(((intCnt-1)-0+1) * Rnd+0)
y=-1
z=0
Exit For
End if
Next
Next
-------------------------