Dim a(100) As Integer
Private Sub Cmd1_Click()
Open App.Path & "\dr021.dat" For Input As #1
Txt1.Text = ""
For i = 1 To 100
Input #1, a(i)
Txt1.Text = Txt1.Text & a(i) & Space(1)
Next i
Close #1
End Sub
Private Sub Cmd2_Click()
Txt1.Text = ""
s = 0
For i = 1 To 100
If a(i) Mod 2 = 0 Then
Txt1.Text = Txt1.Text & a(i) & Space(1)
s = s + a(i)
End If
Next
writedata s
End Sub
有一模板,是不是有模板了,writedata后面就不用加文件名了,比如:writedata "dw021",s这样