Re: VB6 compile error "constant expression required" with enum - solution
- From: "Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 11 Jul 2006 09:58:30 -0400
Interesting solution, and I LOVE the idea that VB won't change the case of
my enumerations...happens to me ALL the time! I wonder if the same trick
will work in Access to solve the enumeration issue? Seems like a lot of
additional typing just for that, but might be worth it in some cases.
Thanks,
Rob
"Jan Hyde" <StellaDrinker@xxxxxxxxxxxxxxxxxxx> wrote in message
news:4nl6b2pb37f83qms9srote7g0i4d100mba@xxxxxxxxxx
I've got a better way, it also solves the problem of VB
ajusting the case of you enumerations
#If 1 = 2 Then
Private Const item1 = 0
Private Const item2 = 1
Private Const item3 = 2
#End If
Private Enum enumBlahBlah
item1 = 0
item2 = 1
item3 = 2
End Enum
Since the first block of code will never be compiled you
don't have to worry about it, but it tricks VB and stops the
error your refering to from happening.
J
.
- Follow-Ups:
- References:
- VB6 compile error "constant expression required" with enum
- From: David Carr
- Re: VB6 compile error "constant expression required" with enum - solution
- From: David Carr
- Re: VB6 compile error "constant expression required" with enum - solution
- From: Jan Hyde
- VB6 compile error "constant expression required" with enum
- Prev by Date: Re: Odd VB 6.0 Bug
- Next by Date: Re: VB6 compile error "constant expression required" with enum - solution
- Previous by thread: Re: VB6 compile error "constant expression required" with enum - solution
- Next by thread: Re: VB6 compile error "constant expression required" with enum - solution
- Index(es):
Loading