在VB用定义不能用dim i,s,k as integer ,而要分别定义
一连串的定义方法是C里面用的
dim i as integer ,s as integer ,k as integer
k=100
for i to k
s=s+(i*i)
next
msgbox s
dim i,s,k as integer
k=100
for i to k
s=s+(i*i)
next
textbox1.text =s
在窗口建立一个commond 和 text块
Private Sub Command1_Click()
Dim i As Integer, S As Double
Dim a As Integer
a = Val(Text1.Text)
S = 0
For i = 1 To a
S = S + i ^ 2
Next i
Print S
End Sub
在窗口建立一个commond 和 text块
Private Sub Command1_Click()
Dim i As Integer
dim S As Long
Dim a As Integer
Text1.Text="100"
a = Val(Text1.Text)
S = 0
For i = 1 To a
S = S + i ^ 2
Next i
Text1.Text= S
End Sub
Dim i as Integer , S as Double
For i =1 To 100
S= S + i ^ 2
Next i
Print S