Wierd thing with a class

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
 
C

Cor

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top