I've been battling for some times now with a little problem which I think has a very easy solution; but can't find it. Maybe I couldn't get the right way to formulate my question on Google... Anyways, I went around it but the way I've done it is very inelegant and cumbersome. What I really want to do would be something like this:
I get, when debugging, the error shown in the picture on that line of code:
the_record.a_table(i).the_name = "Name is:" + i.ToString
What do I do wrong? How can I get `a_table()` in `my_classTwo` to inherit from `my_classOne`?
As I read so unpleasantly in another place; I'm not looking for somebody to write my code; only somebody to tell me where my error is; how I can fix it and then I will do the research. And I'm a beginner so keep the explanation simple? Thanks
VB.NET:
Public Class Form1
Public Class my_classOne
Public the_name As String = ""
Public the_surname As String = ""
End Class
Public Class my_classTwo
Inherits my_classOne
Public a_table(10) As my_classOne
Public a_thing As New my_classOne
End Class
Public the_record As New my_classTwo
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 1 To 10
the_record.a_table(i).the_name = "Name is:" + i.ToString
Label1.Text = the_record.a_table(i).the_name
the_record.a_thing.the_name = "Name: " + i.ToString
Label1.Text = the_record.a_thing.the_name
Next
End Sub
End Class
I get, when debugging, the error shown in the picture on that line of code:
the_record.a_table(i).the_name = "Name is:" + i.ToString
What do I do wrong? How can I get `a_table()` in `my_classTwo` to inherit from `my_classOne`?
As I read so unpleasantly in another place; I'm not looking for somebody to write my code; only somebody to tell me where my error is; how I can fix it and then I will do the research. And I'm a beginner so keep the explanation simple? Thanks