Dark GDK .NET / Initialising an array of Structures |
| Author | Message | ||
|
BatVink
TGC Newsletter Editor ![]() ![]() Joined: Fri Apr 4th 2003 Location: Chilling |
let's hope I can explain this clearly! I have a Structure, and I am having trouble initialising it. Specifically when I try to populate the Vector3 variables, it tells me that they are Nothing, so I need to make them New when the array of this structure is declared. + Code Snippet Next, I added a Sub New to the structure: + Code Snippet Now my problem is that I must supply a parameter, the syntax error being: Structures cannot declare a non-shared 'Sub New' with no parameters. I have no parameter to supply, and this will be an array so I'm not even sure how I would supply it. The second option to fix the error is to make the Sub New shared, but then I get other errors: Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. Does anyone know how I can resolve this. My end goal is to have an array of this structure type with the Vector3s ready to use |
||
| Back to top |
|||
|
Google Ad
AdBot Joined: Aug 26th 2002 Location: Everywhere |
|||
| Back to top |
|||
|
BatVink
TGC Newsletter Editor ![]() ![]() Joined: Fri Apr 4th 2003 Location: Chilling |
|
||
| Back to top |
|||
You must be logged-in to post messages to this forum. You can register an account for free. Or click here to login.
Forum Search
Enter a word or phrase to search our Forum for:
|
|




