Re: Newbie: How to extract year from a Date object
- From: "Someone" <nobody@xxxxxxx>
- Date: Tue, 20 Sep 2005 13:36:21 -0400
I just found out that if you use "Year" as an item in Enum, it will not
work. It would give you a compile time error.
Example:
Private Enum enumDates
Year
Month
Day
End Enum
This will override Year(), Month(), and Day() functions since they are part
of VBA library, which is part of VB6.
To avoid these problems, I always prefix Enum elements with "enm" or "enum".
Most likely I would write it like this:
Private Enum enumDates
enmDateYear
enmDateMonth
enmDateDay
End Enum
"Someone" <nobody@xxxxxxx> wrote in message
news:pnXXe.44109$ct5.2692@xxxxxxxxxxxxx
>I found that VB6 does not prevent you from using Year as a variable, and
>hence, some developers think it doesn't work.
>
>
> "Jeff Johnson [MVP: VB]" <i.get@xxxxxxxxxxx> wrote in message
> news:%23lSce1fvFHA.3764@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> "Newbie" <steve@xxxxxxxx> wrote in message
>> news:GpVXe.812$hW.755@xxxxxxxxxx
>>
>>> I have (had) the following problem which i worked around but i would
>>> still like to find an answer.
>>>
>>> if myDate is e.g. : #02/04/1998# how do i extract the year ?
>>>
>>> Year(myDate) is only for VBA.
>>
>> Since when?
>>
>
>
.
- Follow-Ups:
- References:
- Re: Newbie: How to extract year from a Date object
- From: Someone
- Re: Newbie: How to extract year from a Date object
- Prev by Date: Missing File Export Template in VB.NET
- Next by Date: Re: design patterns
- Previous by thread: Re: Newbie: How to extract year from a Date object
- Next by thread: Re: Newbie: How to extract year from a Date object
- Index(es):
Relevant Pages
|