Results 1 to 3 of 3

Thread: not a member of 'System.Array'

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2006
    Location
    Florida, USA
    Posts
    565

    not a member of 'System.Array'

    I can not figure out why I can not access this public function. I made sure that the class is public. I do not know why I am getting this error either. It is not an Array, it is a custom class.

    Here is the error:
    C:\Reports\Jeff\VB\study\StudyX.NET\frmYourGamesDialog.vb(176): 'findNextQuestionToStudy' is not a member of 'System.Array'.

    Code:
    Code:
    Private Sub frmYourGamesDialog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            frmYourGamesHolder.pauseStudying()
            Module1.questionList.findNextQuestionToStudy()
        End Sub
    A few more INCOMPLETE snippets to let you know how I am declaring stuff:
    Module Module1
    Public questionList(MAxQUESTIONS) As question

    Public Class question
    Public Function findNextQuestionToStudy() As Short
    I use VB .NET 2022. Currently developing StudyX educational software, PlazSales POS system and Yargis a space ship shooter game.

  2. #2
    Fanatic Member MetalKid's Avatar
    Join Date
    Aug 2005
    Location
    Green Bay, Wisconsin
    Posts
    534

    Re: not a member of 'System.Array'

    Public questionList(MAxQUESTIONS) As question declares the variables as an array of questions. If you want to access one, you would do:

    Module1.questionList(0).findNextQuestionToStudy()
    If your problem is solved, please use the Mark Thread As Resolved under Thread Tools!

    Show Appreciation. Rate Posts!

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2006
    Location
    Florida, USA
    Posts
    565

    Re: not a member of 'System.Array'

    Thanks, I should have through of that. Is there a way to make a function that does not require me to specify an individual item in the array? I think I am probably just doing things wrong, but I was curious because I think there is something that allows you to do it in C++.

    Basically, I thought it would be easier if I just made an array, without an additional class that would hold the array. And because I only have one class, I wanted to put the control/utility type of functions in with the class, even though they do not fully belong there.

    Quote Originally Posted by MetalKid
    Public questionList(MAxQUESTIONS) As question declares the variables as an array of questions. If you want to access one, you would do:

    Module1.questionList(0).findNextQuestionToStudy()
    I use VB .NET 2022. Currently developing StudyX educational software, PlazSales POS system and Yargis a space ship shooter game.

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