Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What to use, SET EXACT ON or ==?
Message
From
16/02/2007 11:56:36
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
16/02/2007 11:32:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01196479
Message ID:
01196617
Views:
10
>>>>>>>I guess, being a lazy person <g>, I was looking for a all-inclusive "<>" "exact" operator. That way I would not have to worry about SET EXACT OFF or ON and simply use "==" when comparing for equal and "<==> ((c) Copyright Dmitry Litvak <g>) for not equal.
>>>>>>
>>>>>>Your all-inclusive operation is "NOT a == b"
>>>>>
>>>>>But Sergey said not to use it <g>.
>>>>
>>>>I didn't say that. I said that it's preferable than flipping SET EXACT around which could cause hard to trace bugs in other parts of application..
>>>
>>>Keeping SET EXACT ON makes clean distinction for Seek(), so I prefer it this way.
>>
>>Well that sounds like a candidate for a standard! We're all in agreement. :)
>
>Except that Exact Off is the default, and I guess 99% of Fox programmers never changed it across the board. So, your candidate doesn't have much chance in the real world out there, he already lost.
>
>I've worked on one case where it WAS the standard, and it bit me a few times. I would, for instance, try to compare two strings where the left one was longer, and it kept returning .f. simply because they weren't strictly equal. I actually had to know the length of the right string, and apply "if left(leftstring, len(rightstring))=rightstring" to get what I would get with "if leftstring=rightstring" using Exact Off.
>
>It was the same puzzle I had to deal with, in the other direction, when I switched from Cobol (and other languages) to Fox.

I'm sorry Dragan. I was excited that finally, for once, some kind of consensus might possibly have been reached by a group of people who use "logic". I thought he meant to KEEP set exact at its default. SET EXACT OFF is my expectation. Exact matches should be handled manually as they will then work properly regardless of the SET EXACT setting.

Flipping SET EXACT from the default should be the exception.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform