Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Scan..EndScan code help
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00166652
Message ID:
00166656
Views:
20
Brenda,

SCAN works on teh work area selected when teh SCAN line is first hit. You can change work areas inside the SCAN if you want and the ENDSCAN will reselect the original work area.

You can adjust your code like the following;
** Update customer.dbf with the updated records from oTemp
SELECT customer
SET ORDER TO TAG cid_cseq
SELECT oTemp
LOCATE FOR Cust_seq = Customer.Cust_seq
SCAN WHILE cust_id = m.cust_id
      SCATTER MEMVAR MEMO
      SELECT collat  && what is this work area?
      GATHER MEMVAR MEMO
ENDSCAN
The above code will locate the first amtching record in oTemp and then process all records that match.

One problem, every record processed will overwrite the previous data in Collat because there is no appending of any new records in that table.
Previous
Reply
Map
View

Click here to load this message in the networking platform