Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

I have a struct named "Screen." By best guess is that my problems are somehow related to a name conflict with the System.Windows.Forms.Screen class. Here is my problem:

 

I have shared (static in c#, i believe) members with initializers in the declaration (Shared i As Integer = 7 / int i = 7; ). I am recieving errors that "initializers on structure members are valid only for constants." When I change the name of the struct, all my errors dissapear...

[sIGPIC]e[/sIGPIC]
  • Leaders
Posted
I thought that shared members were a different case. I changed the name of the struct and the error for the illegal initializers dissapeared. Other errors appeared though because of the reference to a nonexistant type (due to the name change) and must have caused to compiler for some reason to ignore the illegal initializers, hence my confusion.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...