高职1年级学生求助哇0 0
我做的一个打开文档保存
然后想再保存的里面读取那个数据
每一个text中都是那一条
可是数据分组总显示没排得第一个
我的代码
Private Sub Command1_Click()
Open "D:\111.txt" For Append As #1
Print #1, Text1.Text, Text2.Text, Text3.Text, Text4.Text, Text5.Text
Close #1
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Dim a(100) As String
Open "d:\111.txt" For Input As #1
i = 1
Do While Not EOF(1)
Input #1, a(i)
i = i + 1
Loop
Text1.Text = a(1)
Text2.Text = a(1)
Text3.Text = a(1)
Text4.Text = a(1)
Text5.Text = a(1)
求帮忙改一下 有5个text 每个中打一个数
再保存 取出时 在原来的那个text中
再点另一个按钮 会出现下一个
[解决办法]
Private Sub Command1_Click()Open "D:\111.txt" For Append As #1Write #1, Text1.Text, Text2.Text, Text3.Text, Text4.Text, Text5.TextClose #1Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""Text5.Text = ""Text1.SetFocusEnd SubPrivate Sub Command2_Click()Dim a(4) As StringStatic row As LongOpen "d:\111.txt" For Input As #1For i = 0 To rowIf Not EOF(1) Then Input #1, a(0), a(1), a(2), a(3), a(4) Else row = 0NextText1.Text = a(0)Text2.Text = a(1)Text3.Text = a(2)Text4.Text = a(3)Text5.Text = a(4)row = row + 1Close #1End Sub