I have this code that phases a text file, formats it, and then creates a List(Of String) for each new line. Now what I want to do is create a class out of that List(Of String) so it can be accessed from anywhere in the program , and be able to pass it an integer parameter and it should return the string value of the integer index of the List(Of Strings). (I guess not sure if that's the right approach??) A bit confusing **
So for example: say I have the following
Dim gcodelist As New List(Of String)
Dim lines As String() = TextBox1.Text.Split(New String() {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
For Each l As String In lines
gcodelist.Add(l)
Next
I want to be able to turn that code into a class so that in Main sub() I can just call for example
Sub Main()
MsgBox(Gcodeblock(5))
End Sub
And it should print gcodelist(5) of the List (Of String) array to the msg box