Dim nameu As String
Dim chinese As Integer
Dim math As Integer
Dim english As Integer
Dim computer As Integer
Dim sum As Integer
Dim n As Integer
----------------------------------------
Private Sub cmdnext_Click() '讀取
a = FreeFile
Open "\yyy.txt" For Input As #a
Do Until EOF(a) '讀取出來全部都是0
With aa
txtnameu = nameu
txtchinese = chinese
txtenglish = english
txtmath = math
txtcomputer = computer
txtsum = sum
End With
Line Input #a, aa
Loop
Shape1.Height = (chinese / n) * 40 '長條圖
Shape2.Height = (english / n) * 40
Shape3.Height = (math / n) * 40
Shape4.Height = (computer / n) * 40
Shape1.Top = 3600 - (chinese / n) * 40
Shape2.Top = 3600 - (english / n) * 40
Shape3.Top = 3600 - (math / n) * 40
Shape4.Top = 3600 - (computer / n) * 40
lblp = chinese / n
lblo = english / n
lbli = math / n
lblu = computer / n
Close #a
End Sub
---------------------------------------------
Private Sub cmdsave_Click() '寫入
a = FreeFile
Open "\yyy.txt" For Append As #a
'With mea
Write #a, txtnameu, txtchinese, txtcomputer, txtenglish, txtmath, txtsum
'End With
n = n + 1
lblnum = n
cmdsave.Enabled = False
cmdnew.Enabled = True
cmdload.Enabled = True
cmdnext.Enabled = True
txtnameu = ""
txtchinese = ""
txtenglish = ""
txtmath = ""
txtcomputer = ""
txtsum = ""
Close #a
End Sub
---------------------------------------------
麻煩請高手修正錯誤在哪裡
再次麻煩高手如何一筆一讀出來!!!
小弟我是新手還請多多見諒*****
Dim chinese As Integer
Dim math As Integer
Dim english As Integer
Dim computer As Integer
Dim sum As Integer
Dim n As Integer
----------------------------------------
Private Sub cmdnext_Click() '讀取
a = FreeFile
Open "\yyy.txt" For Input As #a
Do Until EOF(a) '讀取出來全部都是0
With aa
txtnameu = nameu
txtchinese = chinese
txtenglish = english
txtmath = math
txtcomputer = computer
txtsum = sum
End With
Line Input #a, aa
Loop
Shape1.Height = (chinese / n) * 40 '長條圖
Shape2.Height = (english / n) * 40
Shape3.Height = (math / n) * 40
Shape4.Height = (computer / n) * 40
Shape1.Top = 3600 - (chinese / n) * 40
Shape2.Top = 3600 - (english / n) * 40
Shape3.Top = 3600 - (math / n) * 40
Shape4.Top = 3600 - (computer / n) * 40
lblp = chinese / n
lblo = english / n
lbli = math / n
lblu = computer / n
Close #a
End Sub
---------------------------------------------
Private Sub cmdsave_Click() '寫入
a = FreeFile
Open "\yyy.txt" For Append As #a
'With mea
Write #a, txtnameu, txtchinese, txtcomputer, txtenglish, txtmath, txtsum
'End With
n = n + 1
lblnum = n
cmdsave.Enabled = False
cmdnew.Enabled = True
cmdload.Enabled = True
cmdnext.Enabled = True
txtnameu = ""
txtchinese = ""
txtenglish = ""
txtmath = ""
txtcomputer = ""
txtsum = ""
Close #a
End Sub
---------------------------------------------
麻煩請高手修正錯誤在哪裡
再次麻煩高手如何一筆一讀出來!!!
小弟我是新手還請多多見諒*****
文章標籤
全站熱搜

程式好像沒有錯誤,應該是錯在邏輯的地方,所以我檢查了一下>_<,提供一個意見,以下這個地方使用的並非陣列,只會留下最後一筆資料。(僅供參考) Do Until EOF(a) '讀取出來全部都是0 With aa txtnameu = nameu txtchinese = chinese txtenglish = english txtmath = math txtcomputer = computer txtsum = sum End With Line Input #a, aa Loop
謝了