VB 定义整形数值
定义一组随机数字,要求控件输出的为整数,但结果却输出小数,不知道哪里错了??程序如下:
Private Sub Command1_Click()
Dim a, b, c, d, e, f, g, h As Integer
a = 36 * Rnd
b = 36 * Rnd
c = 36 * Rnd
d = 36 * Rnd
e = 36 * Rnd
f = 36 * Rnd
g = 36 * Rnd
h = 36 * Rnd
Text1(0).Text = a
Text1(1).Text = b
Text1(2).Text = c
Text1(3).Text = d
Text1(4).Text = e
Text1(5).Text = f
Text1(6).Text = g
Text1(7).Text = h
End Sub
VB里面定义一堆变量不能这么写,每个变量都要写成 varname as vartype的样子,或者用类型声明字符。
Dim a, b, c, d, e, f, g, h As Integer,这样写只有h是整型,其他全是变体型,而变体型变量可以存任何内容,当然也包括小数。
答:If Len(Inet1.OpenURL(" ")) <> 0 Or_ Len(Inet1.OpenURL(" ")) <> 0 Then MsgBox "成功...详情>>
答:Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFile...详情>>