VB初心者質問スレ Part4
■ このスレッドは過去ログ倉庫に格納されています
0158113
NGNGえと、DateとかEndは予約語なんでクラスのメンバ変数に使えないような。
あとInputステートメントはデータをObject変数に格納できなかったハズ(?)なんで
代入用の変数を用意しる。
Dim Scedules As New Collection
Dim newScedule As Scedule
Dim lintDate As Integer
Dim lintStart As Integer
Dim lintEnd As Integer
Open "Hoge.csv" For Input As #1
Do Until EOF(1)
Set newScedule = New Scedule
Input #1, lintDate, lintStart, lintEnd
newScedule.nDate = lintDate
newScedule.nStart = lintStart
newScedule.nEnd = lintEnd
Scedules.Add newScedule
Set newScedule = Nothing
Loop
Close #1
取り出すときは、Itemメソッド
Scedules.Item(n).nDate
もしくは、
' For Each newScedule In Scedules
' Debug.Print newScedule.nDate, newScedule.nStart, newScedule.nEnd
' Next
動くと思う。長くてスマソ。
■ このスレッドは過去ログ倉庫に格納されています