Here is what the final procedure needs to accomplish.
It Receives a string and returns an ArrayList. The string represents the location of the CD.txt file. here is an example of the text.txt file.
100;All That You Cant Leave Behind;U2;16.99;34;00005.jpg
The procedure will read the text file and create a CD object for each CD in the file. The file has one CD per line.
is this doing what i am asked?
I guess just copy and paste it.
It has a lot of chicken scratch in it but is does run.
If this is not right then what do it do? It needs to be a function i guess.
Sub Main()
Dim arrlst As New ArrayList()
Dim cddisk As CD
Dim filenum As Integer = FreeFile()
Dim filename As String = "C:\mydocuments\text.txt"
Dim disk As New CD()
Dim str As String()
Dim limiter As String = ";"
FileOpen(filenum, filename, OpenMode.Input)
Dim j As Integer
For j = 0 To 1
Dim arr As String()
Dim i As Integer
Do Until EOF(filenum)
Read one line of the line
Dim test As String = (LineInput(filenum))
arr = test.Split(limiter)
For i = 0 To arr.GetUpperBound(0)
Console.WriteLine(arr(i))
Next
Loop
Close File
FileClose(filenum)
Console.ReadLine()
Dim i As Integer
For i = 0 To 5
arr = str.Split(limiter)
Console.WriteLine(arr(i))
Next
disk.setid(arr(0))
disk.settitle(arr(1))
Console.WriteLine(disk.GetID)
Console.WriteLine(disk.GetTitle)
Dim disk As New CD(arr(0), arr(1))
arrlst.Add(disk)
Next
For j = 0 To arrlst.Count
cddisk = arrlst(j)
Console.WriteLine(cddisk.GetID())
Console.WriteLine(cddisk.GetTitle())
Next
Console.Read()
End Sub
thank you for your help.
It Receives a string and returns an ArrayList. The string represents the location of the CD.txt file. here is an example of the text.txt file.
100;All That You Cant Leave Behind;U2;16.99;34;00005.jpg
The procedure will read the text file and create a CD object for each CD in the file. The file has one CD per line.
is this doing what i am asked?
I guess just copy and paste it.
It has a lot of chicken scratch in it but is does run.
If this is not right then what do it do? It needs to be a function i guess.
Sub Main()
Dim arrlst As New ArrayList()
Dim cddisk As CD
Dim filenum As Integer = FreeFile()
Dim filename As String = "C:\mydocuments\text.txt"
Dim disk As New CD()
Dim str As String()
Dim limiter As String = ";"
FileOpen(filenum, filename, OpenMode.Input)
Dim j As Integer
For j = 0 To 1
Dim arr As String()
Dim i As Integer
Do Until EOF(filenum)
Read one line of the line
Dim test As String = (LineInput(filenum))
arr = test.Split(limiter)
For i = 0 To arr.GetUpperBound(0)
Console.WriteLine(arr(i))
Next
Loop
Close File
FileClose(filenum)
Console.ReadLine()
Dim i As Integer
For i = 0 To 5
arr = str.Split(limiter)
Console.WriteLine(arr(i))
Next
disk.setid(arr(0))
disk.settitle(arr(1))
Console.WriteLine(disk.GetID)
Console.WriteLine(disk.GetTitle)
Dim disk As New CD(arr(0), arr(1))
arrlst.Add(disk)
Next
For j = 0 To arrlst.Count
cddisk = arrlst(j)
Console.WriteLine(cddisk.GetID())
Console.WriteLine(cddisk.GetTitle())
Next
Console.Read()
End Sub
thank you for your help.