GIS的积累
It is never to late to learn

导航

 

Option Explicit
Option Base 1
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Const Nums = 10
Private Sub Command1_Click()
Dim t As Long
Dim Num(Nums) As Long
Dim i, n As Long
Dim s As String
t = timeGetTime
Randomize
For i = 1 To Nums
n = Int(Rnd * Nums) + 1
If Num(n) = 0 Then
   Num(n) = n
   s = s & n & ","
Else
   i = i - 1 '比较妙
End If
Next i
Text1.Text = s
t = timeGetTime - t
MsgBox t
End Sub
 


 

posted on 2010-12-19 12:16  GIS的学习  阅读(161)  评论(0编辑  收藏  举报