Re: Newbie: How to extract year from a Date object
- From: "DRBarkley" <David.NOSPAMBarkley@xxxxxxxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 07:33:02 -0400
"Jeff Johnson [MVP: VB]" <i.get@xxxxxxxxxxx> wrote in message
news:%23XRKsP6vFHA.3312@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
> news:HYKdndx_p8bjOq_eRVn-gA@xxxxxxxxxxxxxxx
>
> >> It doesn't prevent you from using any function name as a variable. One
> >> regular around here posted some code a while back with a variable named
> >> "str" which he said he used all the time as a throwaway name. We were
> >> surprised that it didn't conflict with the Str() function, and he was
> >> surprised to learn that the Str() function existed. Gotta love VB....
> >>
> >>
> >
> > My favorite "shoot oneself in the foot"...
> >
> > I created a Class mimicking a data structure and one of the members was
> > "ID". So I created a quite logically named member variable - "mID".
> > I am embarrassed to report that there several hours of grief before I
> > recognized what the problem was. <g>
>
> And the IDE never changed it to Mid?
>
>
Jeff,
When I read this the other day, it rang a bell that I had just added mID to
one of my classes.
I just got a chance to investigate it, and I had to share:
When I searched for "mID", I found that all of my Mid() functions had been
"renamed" to mID.
Typing over them didn't help, either; they would just revert to from Mid()
back to mID().
Interestingly, there were no errors, and when I right-clicked mID, and
selected "Definition", it went to the Dim'd one.
In an attempt to fix it, I renamed my member variable (I used m_ID), but the
mID() held its caseness (made that up myself).
Even after saving, exiting, and restarting VB, it persisted!
To fix it, I Dim'd a variable with the correct case, saved it, deleted the
"Dim Mid..." line, and re-saved it.
Fun, fun,
DRBarkley
.
- References:
- Re: Newbie: How to extract year from a Date object
- From: Someone
- Re: Newbie: How to extract year from a Date object
- From: Ralph
- Re: Newbie: How to extract year from a Date object
- From: Jeff Johnson [MVP: VB]
- Re: Newbie: How to extract year from a Date object
- Prev by Date: Print white on black
- Next by Date: Re: Software Development - Who owns the creative/resale rights?
- 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
|