Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/01/2008, 20:27
ReViJa
 
Fecha de Ingreso: abril-2007
Mensajes: 187
Antigüedad: 18 años
Puntos: 1
Re: neceisto saber como un randomize no duplique los numeros

Se me ocurre hacerlo así:

Código:
Dim V(100) As String

Private Sub Command1_Click()
Dim N As Integer

Randomize

N = Int((100 * Rnd) + 1)

If V(N) = "" Then
  V(N) = N
  'no se repite
Else
  'se repite
End If

End Sub
Si el valor 0 no se usa declara el vector como Integer y la verificación del if cambia "" por 0, ok.


Saludos.