E
eBob.com
I am getting this error (below) and do not understand how or why.
Perhaps part of the problem is that I am not experienced in OO
programming.
" An unhandled exception of type 'System.NullReferenceException'
occurred in GraphPlay2.exe
Additional information: Object reference not set to an instance of an
object."
This occurs in a very short Sub at the statement indicated ...
Private Sub ReadData()
Dim sInFileName As String = "allfiles.csv"
Dim srInFile As System.IO.StreamReader
Dim DebugTBLines() As String 'for setting TextBox Lines
srInFile = System.IO.File.OpenText(sInFileName)
Do
sInBuf = srInFile.ReadLine()
'MessageBox.Show("Record is """ & sInBuf & """")
If sInBuf Is Nothing Then Exit Do
RecordNumber += 1
If RecordNumber >= MaxFiles Then
MessageBox.Show("Too Damn Many Files; Giving Up")
Close()
Else : ParseInput()
DebugTBLines(RecordNumber) =
FileInfo(RecordNumber).Name '<<<< Error Happens Here !!!
End If
Loop
srInFile.Close()
TextBox1.Lines = DebugTBLines
End Sub 'ReadData
The Watch Window proves that RecordNumber has a value, 0, and that
FileInfo(0).Name has a value.
I'll appreciate any help/adivce/pointers you can offer.
Thanks, Bob
Perhaps part of the problem is that I am not experienced in OO
programming.
" An unhandled exception of type 'System.NullReferenceException'
occurred in GraphPlay2.exe
Additional information: Object reference not set to an instance of an
object."
This occurs in a very short Sub at the statement indicated ...
Private Sub ReadData()
Dim sInFileName As String = "allfiles.csv"
Dim srInFile As System.IO.StreamReader
Dim DebugTBLines() As String 'for setting TextBox Lines
srInFile = System.IO.File.OpenText(sInFileName)
Do
sInBuf = srInFile.ReadLine()
'MessageBox.Show("Record is """ & sInBuf & """")
If sInBuf Is Nothing Then Exit Do
RecordNumber += 1
If RecordNumber >= MaxFiles Then
MessageBox.Show("Too Damn Many Files; Giving Up")
Close()
Else : ParseInput()
DebugTBLines(RecordNumber) =
FileInfo(RecordNumber).Name '<<<< Error Happens Here !!!
End If
Loop
srInFile.Close()
TextBox1.Lines = DebugTBLines
End Sub 'ReadData
The Watch Window proves that RecordNumber has a value, 0, and that
FileInfo(0).Name has a value.
I'll appreciate any help/adivce/pointers you can offer.
Thanks, Bob