Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Exact On or Off
Message
From
11/07/2011 17:11:57
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01517890
Message ID:
01517908
Views:
45
>>Thank you. But what do you do when you need to SEEK() on exact value?
>>
>
>SEEK already always work on the exact search pattern although you can control it with SET NEAR ON.
>
>
>>>I generally set it off, then use == where I want an exact match
>>>
>>>
>>>>Hi,
>>>>
>>>>I ran into a problem today that was caused by the fact that in one of the form's LOAD method there was SET EXACT ON. So I started checking further and found that a few other forms have SET EXACT ON in the LOAD. I am not going to ask why I put this code there <g> (who knows). But in general do you recommend never to have SET EXACT ON as global setting (in LOAD) and only set it ON in places where it is necessary and then reset it back to OFF?
>>>>
>>>>TIA.

SET EXACT does have an effect, as shown below:
CREATE CURSOR Test ;
	( cStr C( 4 ) )

INSERT INTO Test ;
	( cStr ) ;
	VALUES ;
		( "1234" )

SELECT Test
INDEX ON cStr TAG cStr

SET EXACT OFF
SEEK "123"
? FOUND()  && returns .T.

SET EXACT ON
SEEK "123"
? FOUND()  && returns .F.

USE IN Test
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform