Wierd thing with a class

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

ok i got this wierd problem which took me 4 hours already and im still stuck :/ anybody know what is wrong here

------Code-----

Public Class guildnod
Private node() As TreeNod
Private tot As Intege
Sub New(ByVal gname As String
tot =
node(tot) = New TreeNode(gname
End Su
Function add(ByVal name As String
node(tot) = New TreeNode(name
tot = tot +
End Functio
Function getit() As TreeNode(
Return nod
End Functio
Function total() As Intege
Return tot -
End Functio
End Clas

-----/code-----

from my main script it's called like this

Dim snodes As guildnode(
snodes(0) = new guildnode("Description"

that part gives the error, a SystemNullException saying node in the class equals Nothin

Shaman
 
Hi Shaman,

I think that it si because your array of nodes is empty.

You should or use an arraylist or give it a dimension or use redim.

Private node(10) as ThreeNode

I hope this helps,

Cor

what is wrong here:
 
Back
Top