Re: Newbie: How to extract year from a Date object




"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




.



Relevant Pages

  • Re: Actual Lottery Stuff. WOW eh?
    ... I thought that all sounded like lots of fun, ... to fix it, if those are what you're talking about. ... room, waiting, waiting, waiting... ... or module level, but that would work. ...
    (rec.gambling.lottery)
  • Re: DEep breaths. ITS ONLY A NG...BEWARE REALLY BAD WORDS
    ... >> Those words were posted to me years ago by you, along with the advice ... You can deny your responsibility ... Telling people how to fix their ... >> fun as tormenting people like Lori. ...
    (alt.med.fibromyalgia)
  • Re: Hi
    ... that from a personal support pov, a PC is bother easier and cheaper to ... fix and for me and millions of others, ... I had much more fun at my last job where, on a couple of occasions, we ... the hardware engineer hadn't checked the board layout, ...
    (uk.comp.sys.mac)
  • Re: Hi
    ... that from a personal support pov, a PC is bother easier and cheaper to ... fix and for me and millions of others, ... I had much more fun at my last job ... the hardware engineer hadn't checked the board layout, ...
    (uk.comp.sys.mac)
  • Re: GREP
    ... sorry about the horrid casts to int. ... to fix up problems in the is.... ... Try simply receiving str as an unsigned char* ...
    (comp.lang.c)