|
-
Mar 1st, 2004, 07:03 AM
#1
Thread Starter
Member
Help.net
Ok, so here's the deal: you help me, i'll be in your debt for the next 30 years! or i can just say 'thanks'.
I have two structure: board (grid(5,5) as short) and shape(grid(5,5) as short; name as string; h,w as short)
I also have an array of shapes named Shapes(28) as shape.
i have a function that integrates the shape into the board, and i have a sub that loops through Shapes(i) and intgreates them into a certain user-determined board.
BUT, i keep getting the following message:
An unhandled exception of type 'System.NullReferenceException' occurred in ShapeShifterSolution.exe
Additional information: Object reference not set to an instance of an object.
SO... Can anyone tell me HOW to set the object refrence to an instance of an object? 
Thank you for reading this.
i like my icon, made it myself...
except for Buttercap of course.
and for the symbol in the back that is copied from Slipknot...
I like the icon i use but isn't really mine.
-
Mar 1st, 2004, 08:11 AM
#2
I wonder how many charact
That error means you created a reference for an object, but never told the compiler what object that reference points to.
If you did this:
VB Code:
Dim X As DataSet
Debug.WriteLine (x.Tables.Count)
You would get that error. You declared X as a reference to a dataset, but haven't either initialized one(using New), or set X to an existing dataset.
VB Code:
Dim X as [b] New [/b] DataSet
Debug.WriteLine (x.Tables.Count)
So, my guess: You are missing a New operator somewhere(perhaps Shapes?), or you are setting a reference to something that wasn't created (perhaps it had no data in it)
-
Mar 1st, 2004, 08:33 AM
#3
Thread Starter
Member
Wow. thanks. I went and replaced all the related variables with "new"... however... i currently use this definition of shapes:
Public Shapes() as shape
and later i ReDim it and initialize the shapes in it, problem is: "Can't use new on arrays"
and my question is: What can i do? Is by any chance your example of "datasets"(never heard of them) is the answer?
Thank you very very much!
i like my icon, made it myself...
except for Buttercap of course.
and for the symbol in the back that is copied from Slipknot...
I like the icon i use but isn't really mine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|