Re: Why Compiler Const Error when no Compiler Const exists

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



The VB6 compiler can't tell the two eNone enumerations apart. This is a
design bug in the compiler. The workaround is to prefix all enumeration
values with a unique (to the enum statement) prefix.

Mike Ober.

"thejamie" <thejamie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9CCDD42F-27CC-48AA-8A8D-F3CAC148169B@xxxxxxxxxxxxxxxx
> It may be the enumerated constants. I moved some around and made one
> particular set Public since I use it in many places throughout the
program.
> When I make it a public rather than a private enumerator set, the error
> returns.
>
> Example:
> Public Enum MyEnum
> eNone
> eOne
> End Enum
>
> In another module
> Public Enum MyOtherEnum
> eNone
> eSomethingElse
> End Enum
>
>
>
> --
> Regards,
> Jamie
>
>
> "MikeD" wrote:
>
> >
> > "thejamie" <thejamie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:EF318380-9038-4737-8086-072EFE43BCD3@xxxxxxxxxxxxxxxx
> > > Bob,
> > >
> > > Version VB6 SP6.
> > >
> > > Error is straightforward:
> > > Modal header is "Microsoft Visual Basic"
> > >
> > > Message is "DUPLICATE DEFINITION"
> > >
> > > the message provides an OK and HELP option.
> > >
> > > I click OK and tried to open the program again - got the same message.
> > This
> > > happened after a compile.
> > >
> >
> > You most likely have 2 procedures of the same name and within the same
> > scope. Since VB can't determine which one you intended to call, it
raises a
> > duplicate definition error. Search your project for the procedure and
limit
> > the scope of one of the procedures, or if the procedures are actually
> > identical, eliminate of them.
> >
> > Mike
> >
> >
> >
>



.



Relevant Pages

  • Re: Type alias in C#
    ... Since enumerations are ValueTypes, ... why does your logic for the presence of the keyword "Structure" not apply to the presence of the keyword "Enumeration" as well? ... I just can't understand how an enum can be considered a structure when it only shares one feature of structures: ... And, using your own argument, the MSDN documentation never refers to an enumeration as a "structure". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: To const or to enum?
    ... > out on the side of using enumerations over static constants. ... be losing any sleep over an enum. ... Each node type is assigned an integral constant ...
    (comp.lang.cpp)
  • Re: defining arithmetic for enums
    ... I am saying that incrementing an enum type is ... "Well-Behaved Enumerations," Embedded Systems Programming, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Utility to extract/print all enumerations?
    ... >> window resulted in exactly the same listing of the enumerations ... > Well dragging the Constants node results in all the constants being ... > dumped in alpha order with no regard to the Enum groupings. ... i x dot n e t c o m dot c o m ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Enumeration idioms: Values from different enumerations
    ... >>> whole point of enumerations is to avoid errors in such cases. ... >> if a specific enum value is in the list, and the obvious way to check ... > What's being discussed here is what happens when comparing the *values* ...
    (comp.lang.python)