to:jlt2000(红尘牛仔) 
有没有其他方法,当生成的数目太多时,会影响到速度吧!

解决方案 »

  1.   

    to:jlt2000(红尘牛仔) 
    有没有其他方法,当生成的数目太多时,会影响到速度吧!
      

  2.   

    For i = txt1 To txt2
    100:
        Close #1
        Open App.Path + "\cj.txt" For Input As #1
            a(i) = Int(L_hs * Rnd) + 1
            For j = 0 To i - 1
                If a(i) = a(j) And i <> j Then
                DoEvents
                GoTo 100
                End If
            Next j
            
            For c = 0 To a(i)
                Line Input #1, inputdata  '顺序取一行
            Next c
            b(i) = Trim$(inputdata)
            lbe.AddItem b(i)
            Close #1
        Next i
    刚刚得到
    看看行不??
      

  3.   

    to:LIKEVB(*^-^*,能笑两笑就好了)
    这样好象不行啊
      

  4.   

    dim a(99999) as boolean
    dim b() as long
    dim i as long
    dim k as long   '随机数的个数k = 100 '设 k 为100redim b(k-1)
    randomize
    for i=0 to k-1
      do
         b(i)=int(rnd*100000)
      loop until not a(b(i))
      a(b(i)) = true
    next i
      

  5.   

    TO : zengxianfeng() 
    我们一直在用它
    您瞅准了“…………”
    没问题的
    我正在写这个东西
    1分钟执行一遍
      

  6.   

    BigRichBigNoble(大富大贵)说法的却不错,就是不太明白原理
      

  7.   

    在rand前面加上randomize不就行了