# Re: 气死我了，快拉兄弟一把！

Posted by 纪文和 on April 28, 1999 at 14:10:42:

In Reply to: 气死我了，快拉兄弟一把！ posted by 八戒 on April 28, 1999 at 01:33:41:

您的程式逻辑有点怪怪的!
-------------------------------------------------------------
For j = 0 To i 'compare iLuckyNumber with numbers on previous labels
If iLuckyNumber = Val(Label1(j).Caption) Then 'if new number is the same as previous, reset i=i-1 to do it again
i = i - 1
End If
Next j
上面这段,当您发现数字重复时, 实际上并没有重新产生乱数!
Label1(i).Caption = iLuckyNumber
-------------------------------------------------------------
您可以修修程式, 否则我提个想法参考看看!

1.在 Form 上放一个 List1, Form_load 时用 additem 在 List1 中加入1-49 的数字,
2.Command1_Click 时, 再从 list1 中取出6个数, 取出一个, removeitem 一个

Follow Ups:

- Re: 气死我了，快拉兄弟一把！ 八戒 22:16:41 4/28/99 (0)