|
-
May 1st, 2007, 02:50 PM
#1
Thread Starter
Fanatic Member
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.
-
May 1st, 2007, 02:58 PM
#2
Fanatic Member
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!
-
May 2nd, 2007, 10:20 AM
#3
Thread Starter
Fanatic Member
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.
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|