I am trying to make a program that takes a text from a file and writes it into a label in visual studios 10. I want to be able to click buttons on the exe to make it go from the previous line to the next line and vise versa. I am storing the text into an array and then making the label equal the text on the given part of the array. I am receiving the error "Object reference not set to an instance of an object." Can anyone help ? thanks. here is part of my code my code:
Private Sub BrowseButton_Click(sender As System.Object, e As System.EventArgs) Handles BrowseButton.Click
Dim UserInput As DialogResult = Browser.ShowDialog()
If UserInput = Windows.Forms.DialogResult.Cancel Then
Return
End If
FileOpen(1, Browser.FileName, OpenMode.Input)
Do While Not EOF(1)
Input(1, InternalTextFile(Index))
Index += 1
Loop
FileClose(1)
Output1Text.Text = InternalTextFile(Index)
Output2Text.Text = InternalTextFile(Index + 1)
End Sub
The error arises On the line Input(1, InternalTextFile(Index))