definitely useful. I wish there were a FindNoCase() equivalent.
"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:lHVHi.50873$Um6.31878@newssvr12.news.prodigy.net...
if(s != _T("12345") )
...
if( s.Compare( _T("12345") ) )
Ah, but you would really need:
if( s.Compare( _T("12345") == 0 ) )
No. Compare() returns non-zero if the strings differ - like strcmp().
if (s != _T("12345") )
which illustrates the intent perfectly.
I agree it looks nicer. But as I say it leaves me a little nervous, if
irrationally so. [Not *that* irrational, otherwise the OP wouldn't have
had a problem!]
But I don't go for all that ==0 stuff. I was using C long enough to get
used to writing
if( n )
for any integer type. Similarly I never write if( p!=NULL ) for pointers
but just if(p). And things like
TCHAR *psz;
...
if( psz && *psz ) ....
The idiom is now so familiar that I no longer feel the need for my usual
degree of pedantry :-)
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm