Re: Making an Enum gloabl

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 04/09/04


Date: Fri, 9 Apr 2004 17:57:23 -0500

Sapporo,
I tend to prefer:

> Public Enum MyEnum
> enumval01
> enumval02
> End Enum

> Public Module modDeclarations

> End Module

As the module is NOT needed to hold the Enum declaration. Enum declarations
can exist at the Namespace level just like Class, Module, Interface, and
Delegate.

Hope this helps
Jay

"Sapporo" <sapporo.NO5PAM@shackmail.com> wrote in message
news:%23Sw2TSoHEHA.3240@TK2MSFTNGP12.phx.gbl...
> This will also make your enum global
>
> Public Module modDeclarations
> Public Enum MyEnum
> enumval01
> enumval02
> End Enum
> End Module
>
> "Chad" <chad.dokmanovich@unisys.com> wrote in message
> news:c56mi2$jkl$1@trsvr.tr.unisys.com...
> In VB6, Enums that I declare within a class as PUBLIC are know outside of
> this class. In otehr words, the enum is global and may be referenced
outside
> of the class in which it is declared.
>
> In VB.Net, a Public enum is local to the class in which it is declared or
> instances of the class or classes that inherit from the class in which the
> Enum declaration resides.
>
>



Relevant Pages

  • Re: enum type declaration error
    ... is the code missing a; after the enum declaration line? ... there is C equivalent "enum" type existed in JAVA. ... initial experiment is giving compile error as below. ... public enum returnStatus ...
    (comp.lang.java.programmer)
  • Re: Enum causes compiler errors
    ... unneeded semi-colon at the end of the enum declaration. ... > When I compile the web app which uses the web control I get: ... > An internal error has occurred in the compiler. ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: p124 K&R
    ... In order for the enum declaration to define an object, ... With a macro the answer is ... That all depends on the debugger. ...
    (comp.lang.c)
  • Re: p124 K&R
    ... In order for the enum declaration to define an object, ... With a macro the answer is ... That all depends on the debugger. ...
    (comp.lang.c)
  • Re: vb .net newbie. I need to pass a variable to a form from my menu - How?
    ... why does it need to be fully qualified if it is a public enum? ... lblRSQNumber.Text = "Quote No." ... lblRSQNumber.Text = "Sales No." ...
    (microsoft.public.dotnet.languages.vb)