vb问题急请教各位大侠!!!!
Private Sub Command1_Click()
Dim num As Integer
num = 1
Do Until num > 6
Print num;
num = num + 2.4
Loop
End Sub
上段程序为什么输出的是整型的数值
麻烦各位大侠告诉一声,不胜感激!!!!!
[解决办法]
Dim num As Integer
变量声明类型为整型的当然是那样的结果
[解决办法]
Dim num As double
可以这样声明
[解决办法]
不明白你的程式怎么运行的,VB里面怎么会有逗号
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num As Integer
num = 1
Do Until num > 6
Label1.Text = num & ","
num = num + 2.4
Loop
Label1.Text = Label1.Text.Substring(0, Label1.Text.Length - 1)
End Sub
[解决办法]
说错了,是分号“;”
[解决办法]