Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Initialising an array of Structures

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Nov 2009 12:02 Edited at: 7th Nov 2009 12:05
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.



Next, I added a Sub New to the structure:



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

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK

Login to post a reply

Server time is: 2024-04-18 11:16:58
Your offset time is: 2024-04-18 11:16:58