Hi Joe,
On Apr 18, 2006, at 2:10 PM, Joseph J. Strout wrote:
At 1:03 PM -0500 4/18/06, Scott Thompson wrote:
Try something like this:
Scott, your code is indeed much clearer, but I'd make one suggestion:
if Uppercase(me.Text) = "Y" then 'Note: String comparisons of
this type should NOT be case sensitive
String comparisons in RB are NEVER case sensitive, so the above code
is exactly equivalent to:
if me.Text = "Y" then
and also equivalent to:
if me.Text = "y" then
To call Uppercase on a string, and then compare it (with "=") to
something else, doesn't make sense in a language where case doesn't
matter to comparisons anyway.
Yes, I know, and that is why I put my comment there, but, since Joshua
was having an issue
with the concept that it *might* be case sensitive, bug or otherwise,
it didn't hurt to eliminate
that issue and allow him to focus on the remaining logic is all.
Also, it is very non-intuitive, and when one jumps around from platform
to platform, language to
language, like I do, a little overkill goes a long way to keeping my
code working! It still freaks
me out to not have to use '==' for comparisons in BASIC, and after a
round of C/C++ my grey
matter is constantly reviewing all the 'differences' and wasting time.
Too bad all languages
are not consistent, but then, we'd only have one language, right? :-)
Having programmed
for 30+ years now, 90% of that time, "A" has not been equal to "a", and
now I have to unlearn
that, and so many other things--it is not easy. :-)
Another thing is to realize (in my mind) that there IS a zillion ways
to solve a problem
and that not everyone's logic is 'ideal', but the tools allow us to get
results one way
or another. And thankfully so! I love RealBasic, as you do, but it can
still be confounding
and confusing at times, especially after living through all the
previous evolution of
the Real Software tools and their version of the BASIC language.
I only hope that at times I can help someone, like Joshua, get past
something frustrating
and on to better things. One way, or another. As I have been there too
many times
before... like most of us I suppose.
Best,
- Joe
-Scott
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>