Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking record and finding next match...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00264789
Message ID:
00266340
Views:
27
>Hi Pete,
>
>>I am using the following to find a matching client number....
>>
>>Seek(This.value,'client','clientnum')
>>
>>Once I locate a match, I need to check a subsequent field for a secondary match (firmid). If this record does not match the firm as well, I need to search for the next match of the clientnum and check the firm and do this until the clientnum is no longer found. How would I do this?
>
>Sounds like you need something like:
>
>SCAN FOR ClientNum=This.Value AND FirmID=xxxx
>   * Do something with the matching records.
>ENDSCAN
>
>Christof


A more optimized use of SCAN is
SCAN 
  IF  ! ClientNum=This.Value OR ! FirmID=xxxx
    LOOP
  ENDIF
   * Do something with the matching records.
ENDSCAN
This avoids VFP putting a filter on the table which will slow it down.
CySolutions, Medical Information Technology
You're only as good as your last
success, so . . .If it works. . .don't fix it!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform