Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Big Problem with simple code
Message
From
07/09/2005 05:01:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01047265
Message ID:
01047280
Views:
9
>The problem as Mike has pointed out is one of an exact match as opposed to a match. The right-hand expression decides how much is checked. So, 'Domestic Chassis LED' = 'Domestic Chassis' since only the length of 'Domestic Chassis' is checked in the left-hand expression. There are a few different ways to fix this...
>1. Switch the expression around
>2. Use the exactly-equals operator "=="
>3. Set Exact On
>
>A simple demonstration may help illustrate this better...
>
>
SET EXACT OFF
>?'Domestic Chassis LED' = 'Domestic Chassis' && .T. -- only len('Domestic Chassis') is checked to see if it matches
>?'Domestic Chassis' = 'Domestic Chassis LED' && .F.
>
>?'Domestic Chassis LED' == 'Domestic Chassis' && .F.
>?'Domestic Chassis' == 'Domestic Chassis LED' && .F.
>
>SET EXACT ON
>?'Domestic Chassis LED' = 'Domestic Chassis' && .F.
>?'Domestic Chassis' = 'Domestic Chassis LED' && .F.
>
>

Craig, Pardon me,
for completeness:
SET ANSI ON is equal to "=="
but
SET EXACT ON is not eqaul to "=="
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform