Results 1 to 4 of 4

Thread: [RESOLVED]Multi-Dimensional Array Get/Set Issue

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOLVED]Multi-Dimensional Array Get/Set Issue

    In my football sim I am trying to save all the info from a game. There are two defined dimensions to this array. The first is the number of weeks(17 always) and then the number of games per week (Number of teams /2). The plays themselves are unknown in quantity so I decided to use List of to store them.

    With this type of multi-dimensional array that is also a List of I am having trouble with the Get and Set properties.

    I have a member variable declared as:
    Code:
        Private m_StoredRegSeasonGames(,) As List(Of CLStoredPlay)
    Later I redim the array:
    Code:
            ReDim m_StoredRegSeasonGames(17, m_intNumberOfTeams / 2)
    My issue is I do not know the proper coding for the Get and Set Properties. This is the closest I could get:
    Code:
        Friend Property StoredPreSeasonGames As List(Of CLStoredPlay)(,)
            Get
                m_StoredPreSeasonGames = m_StoredPreSeasonGames
            End Get
            Set(ByVal value(,) As List(Of CLStoredPlay))
                m_StoredPreSeasonGames = value
            End Set
        End Property
    The only error I get with this version is a warning: StoredPreSeasonGames doesn't return a value on all code paths. Still, something is off. The parentheses and comma look wrongly placed. What am I missing?

    Thanks in advance.
    Last edited by neef; Apr 20th, 2012 at 08:46 PM.
    Intermediate Level Programmer Extraordinaire

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