The files I am trying to read are in a file called systemstate in the bin\debug file. I have a text file call systemdetails in that file and a file in there called Products and a file of products called P0 containing the rest of the text files
in the following lines of code the first readalllines works, the rest fails without any exception raised and the program continues to run as if nothing happened.
in the form1.vb file
Public Sub init()
If start Then
productcount = Int(IO.File.ReadAllLines(filestoreloc + systemfile)(0).Split()(1))
For i As Integer = 0 To productcount
Dim id As String = Str(i)
Dim det As String() = IO.File.ReadAllLines(filestoreloc + Product.location + "P" + id + Product.detailsfile)
Dim desc As String() = IO.File.ReadAllLines(filestoreloc + Product.location + "P" + id + Product.descriptionfile)
Dim rev As String() = IO.File.ReadAllLines(filestoreloc + Product.location + "P" + id + Product.reviewfile)
products.Add(New Product(det, desc, extractRecords(rev, Product.revstartmark, Product.revendmark)))
Next
start = False
End If
End Sub
This method is invoked from the Form1_load method
these are the variables used in the above code:
in the form1.vb file
Property filestoreloc As String = "systemstate\"
Property systemfile As String = "systemdetails.txt"
Property productcount As Integer
Property start As Boolean = True
in the product.vb file
Public Shared Property location As String = "Products\"
Public Shared Property detailsfile As String = "\details.txt"
Public Shared Property descriptionfile As String = "\description.txt"
Public Shared Property reviewfile As String = "\reviews.txt"
Public Shared Property revstartmark As String = "[REVIEWSTART]"
Public Shared Property revendmark As String = "[REVIEWEND]"