Now I have defined the ways and workers as
Dim ways() As Long
Dim workers() As Long
it it is giving an error "Invalid qualifier" on line 16...Code:Private Sub loadButton_Click() cd1.DialogTitle = "Load Data" cd1.Filter = "Text (*.txt)|*.txt|Data (*.dta)|*.dta" cd1.ShowOpen Open cd1.FileName For Input As #1 Line Input #1, p wsize = Val(p) ReDim Preserve workers(wsize - 1) Line Input #1, p wasize = Val(p) ReDim Preserve ways(wasize - 1) For x = 0 To wasize - 1 For y = 0 To 6 Line Input #1, q If q = "Yes" Then ways(x).daysRun(y) = 1 End If Next y Line Input #1, ways(x).name Line Input #1, p ways(x).timeOpen = Val(p) Line Input #1, p ways(x).timeClose = Val(p) Next x For x = 0 To wsize - 1 ReDim workers(x).workDoing(0) ReDim workers(x).routeKnown(0) Line Input #1, workers(x).name For y = 0 To 6 Line Input #1, p workers(x).workStart(y) = Val(p) Line Input #1, p workers(x).workEnd(y) = Val(p) Line Input #1, p workers(x).work(y) = Val(p) Line Input #1, p workers(x).deadStart(y) = Val(p) Line Input #1, p workers(x).deadEnd(y) = Val(p) Line Input #1, p workers(x).dead(y) = Val(p) Next y Dim putter As String Dim cntr As Integer cntr = 1 For z = 0 To wasize - 1 Line Input #1, putter If putter = "Yes" Then ReDim Preserve workers(x).routeKnown(cntr) workers(x).routeKnown(cntr) = ways(z) cntr = cntr + 1 ElseIf putter = "Train" Then ReDim Preserve workers(x).routeKnown(cntr) workers(x).routeKnown(cntr) = ways(z) workers(x).routeKnown(cntr).status = 0 cntr = cntr + 1 End If Next z Line Input #1, q r = Val(q) ReDim Preserve workers(x).workDoing(r) For y = 1 To r Line Input #1, p Line Input #1, q For z = 0 To wasize - 1 If ways(z).name = p Then workers(x).workDoing(y) = ways(z) workers(x).workDoing(y).day = Val(q) End If Next z Next y Next x Close #1 End Sub




Reply With Quote