Results 1 to 3 of 3

Thread: Help.net

  1. #1

    Thread Starter
    Member SnappleBoy's Avatar
    Join Date
    Aug 2002
    Location
    Israel!
    Posts
    41

    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.

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    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:
    1. Dim X As DataSet
    2. 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:
    1. Dim X as [b] New [/b] DataSet
    2. 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)

  3. #3

    Thread Starter
    Member SnappleBoy's Avatar
    Join Date
    Aug 2002
    Location
    Israel!
    Posts
    41
    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
  •  



Click Here to Expand Forum to Full Width