精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● VB和Basic>>● VB和Basic(1)>>高级技巧>> 求出任意两个整数之间的随机数?例如:6

主题: 求出任意两个整数之间的随机数?例如:6
发信人: fishy()
整理人: (2000-03-18 20:49:34), 站内信件
【 在 flashboy (flashboy) 的大作中提到: 】

Public Function Random(Min As Integer, Max As Integer) As Integer
    On Error Resume Next
    '产生Min到Max之间的随机整数
    Randomize
    Random = Round(Rnd * (Max - Min + 1) - 0.5) + Min
End Function

--
Dim fishy As Friend
回复时请打勾
------------
欢迎大家访问酷码工作室:http://comma.my163.net

※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.103.37.14]

[关闭][返回]