On Wed, Mar 12, 2014 at 9:24 AM, Paul Newton <[email protected]>wrote:

>  Am I missing something blindingly obvious?
>

Not obvious, but a VFP fundamental: all string comparisons compare the left
string to the right up to the end of the right string, so "Smythe' = "Sm"
and consequently, "Everything" = "" which means, all strings equal the
empty string, so no string can NOT equal the empty string.

ALLTRIM(SPACE(100)) <> SPACE(0)   && False

And worse,

ALLTRIM(" My string is here ") <> SPACE(0)  && also false.

This carries over into the SQL evaluation, which leads to the confusing
result you see.

Testing the length of the trimmed string is one way to avoid this.

-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cacw6n4upydmzmf5ug4c7zcpmigbd3mgdnpn2srvace+wt5k...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to