lamy
Regular
im trying to make a class with an array object in it but somehow reference is lost whenever i add a new item to it
doing this works
but this doesnt
anyone?
Visual Basic:
Public Class MyMenu
Public parent()() As String
Public Function AddParent(ByVal title As String, ByVal link As String) As Int16
Dim id As Int16 = 0
If Not parent Is Nothing Then
id = parent.Length
End If
ReDim parent(id)
parent(id) = New String() {title, link}
Return id
End Function
End Class
doing this works
Visual Basic:
Dim id As Int16
id = m.AddParent("1", "1.htm")
MsgBox(m.parent(0)(1))
id = m.AddParent("2", "2.htm")
MsgBox(m.parent(1)(1))
id = m.AddParent("3", "3.htm")
MsgBox(m.parent(2)(1))
Visual Basic:
Dim id As Int16
id = m.AddParent("1", "1.htm")
id = m.AddParent("2", "2.htm")
id = m.AddParent("3", "3.htm")
MsgBox(m.parent(0)(1))
MsgBox(m.parent(1)(1))
MsgBox(m.parent(2)(1))
anyone?