Skip to main content

AccessTr.neT


Liste Kutusuna Rastgele Benzersiz Sayı Ekleme

Liste Kutusuna Rastgele Benzersiz Sayı Ekleme

#5
dilerim işiniz görür 
çok büyük sayılar girerseniz biraz zaman alabilir
butonun olay yordamına aşağıdaki kodu girin
düzenleme: maalesef tekrar engellenmemiş
while...wend kısmında 1 hata yapmışım galiba
strkar = Null
For xRasgele = 0 To Me.Metin1 - 1

   intrasgele = Int(1000 * Rnd() + 1)
   strkar = strkar & vbCrLf & intrasgele
   While InStr(strkar, " " & intrasgele & " ") > 0
    intrasgele = Int(1000 * Rnd() + 1)
  Wend
   Me.Liste3.AddItem (intrasgele)
Next
For i = 0 To Me.Liste3.ListCount - 1
   For j = i + 1 To Me.Liste3.ListCount - 1
       If Int(Me.Liste3.Column(0, i)) < Int(Me.Liste3.Column(0, j)) Then
       strTempi = Me.Liste3.Column(0, i)
       strTempj = Me.Liste3.Column(0, j)
       Me.Liste3.RemoveItem (i)
       Me.Liste3.AddItem Item:=strTempj, Index:=i
       Me.Liste3.RemoveItem (j)
       Me.Liste3.AddItem Item:=strTempi, Index:=j
       
       End If
    Next
    Next
.rar RASTGELE SAYI_hy.rar (Dosya Boyutu: 13,78 KB | İndirme Sayısı: 6)
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Liste Kutusuna Rastgele Benzersiz Sayı Ekleme - Yazar: berduş - 28/11/2018, 01:24
Task