Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kind of like an incremental search?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00176662
Message ID:
00176703
Views:
24
>> [build m.pcCondition]
>>
>>Then later I do the following:
>>SELECT mytable
>>SET FILTER TO &pcCondition
>>SCAN FOR &pcCondition
>>...
>>ENDSCAN
>>
>>I guess I need something more than mytable.addr = THISFORM.addr.Value.
>>
>I don't want to comment on famous VFP expert example, but in VFP filter will give you more troubles than help. You should use SELECT-SQL or SEEK, so whatever I said in previous reply still applicable. Just one note: when you generate 'filter' (actually WHERE clause of SELECT) apply ALLTRIMs on all character entries.

Besides what Ed says, your code is redundant. If you're using a FOR clause in your SCAN (as you should) then there's no need for setting the FILTER.

For a list of many reasons, most Fox Experts (tm) recommend against using SET FILTER TO. My favorite reason is that it's usually the slowest running way to get to a subset of records. It usually makes more sense to put your filtering condition in the FOR clause of various other commands, or in WHERE or HAVING of SQL-SELECT.

HTH,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Reply
Map
View

Click here to load this message in the networking platform