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:
00166655
Views:
17
>** Update customer.dbf with the updated records from oTemp
>SELECT customer
>SET ORDER TO TAG cid_cseq
>SCAN WHILE cust_id = m.cust_id
>      SELECT oTemp
>      LOCATE FOR cust_seq = customer.cust_seq
>      SCATTER MEMVAR MEMO
>      SELECT collat
>      GATHER MEMVAR MEMO
>ENDSCAN
>
>Can you change the workarea in a SCAN..ENDSCAN?
>
>Having inconsistent and infrequent errors happening during the customer updating. It works 98% of the time. Have not been able to pinpoint the problem, but all the update code looks pretty harmless. This is the only peice of code that strikes me as possibly problematic.
>
>oTtemp is a copy of customer with only the cust_id subset of recs and any editing changes (no adds or deletes). If there are 10 records in otemp, they will all have the same cust_id, and there should be those 10 records in customer. You can not change the cid_seq.
>
>Any Observations?
>
>Brenda

Sure you can change WA in a SCAN, you just need to make sure the original table to be scanned is the currently selected WA before the ENDSCAN. Which is where your problem lies. You really mean to scan oTemp from the looks of it. So oTemp should be before the SCAN command.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform