Newb Question on Array Declaration

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HateSpam

    #1

    Newb Question on Array Declaration

    Using Visual Studio .NET version of Visual Basic.

    I am defining a class that has, as a member, an array of another
    user-defined class.

    private mBoard as CBoardPosition( )

    The problem comes when I attempt to size the array, it should be an 8x8
    grid. When I use:

    mBoard = New CBoardPosition (7,7)

    When I do this, VB thinks I am trying to send two integers to the New
    function of the class, not defining it as a 8x8 2d array. This results
    in an error as the new function of CBoardPosition takes no parameters.

    What is the proper syntax for this? I know I must be missing something
    simple.

  • Randy Birch

    #2
    Re: Newb Question on Array Declaration

    You'd be better off asking in a .net group - this one is for vb6 or earlier.
    Try one of these or some of the many other similarly-named groups devoted
    exclusively to .net programming:

    news://msnews.microsoft.com/microsof...dotnet.general
    news://msnews.microsoft.com/microsof...t.languages.vb
    news://msnews.microsoft.com/microsof....vsnet.general
    news://msnews.microsoft.com/microsof...studio.general
    news://msnews.microsoft.com/microsof....vstudio.setup


    --


    Randy Birch
    MS MVP Visual Basic



    "HateSpam" <HateSpam@nospa m.com> wrote in message
    news:gB%6d.4244 $FZ5.2480@fe2.c olumbus.rr.com. ..
    : Using Visual Studio .NET version of Visual Basic.
    :
    : I am defining a class that has, as a member, an array of another
    : user-defined class.
    :
    : private mBoard as CBoardPosition( )
    :
    : The problem comes when I attempt to size the array, it should be an 8x8
    : grid. When I use:
    :
    : mBoard = New CBoardPosition (7,7)
    :
    : When I do this, VB thinks I am trying to send two integers to the New
    : function of the class, not defining it as a 8x8 2d array. This results
    : in an error as the new function of CBoardPosition takes no parameters.
    :
    : What is the proper syntax for this? I know I must be missing something
    : simple.
    :

    Comment

    Working...