473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Class goes buggy

hi, im working on this app that makes a treenode view out of data from an xml page, yet theres a few pieces of code that just will not get fixed by me.

Anybody help me

(code below

'Class guildnode (Array of members, array index 0 contains name of the group, thus will not be returned with the getit method

Public Class guildnod
Private node(2) As TreeNode 'node(0) contains the name of the group, node(1 to N) contains members
Private tot As Integer 'Total number of members in the nodes() arra
Sub New(ByVal gname As String
node(0) = New TreeNode(gname) 'stores the name of the grou
tot =
End Su
Function add(ByVal name As String) 'add a member to the arra
node(tot) = New TreeNode(name
tot = tot +
If tot = node.Length - 1 Then 'if the array gets to close to reaching the upper bounds, redimension it to make it bigge
ReDim Preserve node(node.Length + 1
End I
End Functio
Function getit() As TreeNode() 'get the members of the grou
Dim nod(tot - 1) As TreeNod
Dim i As Intege
For i = 1 To tot -
nod(i - 1) = node(i
Nex
Return no
End Functio
Function getguildname() As Treenode 'get the name-treenod
Return node(0
End Functio
Function total() As Integer 'get the total amount of members in it - 1 for the spare room for a new membe
Return tot -
End Functio
End Clas

ok, the script continues, members get loaded in another array, which from there will be transfered to the correct group array member (basically i use an array of that class, 1 for every group, number of groups can fluctuate

then this
Dim sna() As TreeNode = snodes(0).getit 'Returns guildnode0 (always exists
Dim snb() As TreeNode = snodes(1).getit 'Returns guildnode1 (always exists
Dim sbc() As TreeNode = snodes(2).getit 'Returns guildnode2 (always exists
Dim staff(6) As TreeNod

then the buggy line

staff(0) = New TreeNode(snodes(0).getname.text, sna

it gives this exception
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dl
Additional information: Object reference not set to an instance of an object.
Nov 20 '05 #1
0 880

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
0
by: mahesh | last post by:
Hi all, I have a doubt with OOAD and Dialogs. I have a Dialog Class. tkSimple.py It contains a class body as below. Now I am calling the tkSimple.py in another python program and using the...
3
by: Peter | last post by:
Hi everybody, I am unfortunately stuck with a probably very simple problem. I made a class called Particle with a valarray (STL) as a class member. The code for the class goes like this: ...
4
by: Earl | last post by:
To upgrade or not? This, to me, is based upon whether or not Microsoft has -- at least -- fixed the buggy controls from VS2003: Combo (clearing and binding context issues) Checked ListBox...
9
by: Ryan | last post by:
Hi all, I'm playing with Lutz Roeders Reflector and have found several areas where I think there are issues in the framework libraries. I can't see how the following should work as expected and...
7
by: pkirk25 | last post by:
Hi, I want to create a class with its definition in cls.h and implementation in cls.cpp I get errors about redfinitions and errors wahtever way I try to initialise the static proivate variable...
31
by: DirtySnipe | last post by:
I have created a php form with dynamic drop down boxes in it which pull the options from a database. The boxes work fine and the data gets submitted fine but im having a problem getting the box to...
34
by: Creativ | last post by:
Why does Thread class not support IDisposable? It's creating quite some problem. Namely, it can exhaust the resource and you have not control over it.
3
by: vern | last post by:
Greetings, how would I pass variables that are outside a class ... to a class? Such as ... $variable_one = 1; $variable_two = 2; class this_is_a_class { public $variable_one; public...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.