Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Scan..EndScan code help
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00166652
Message ID:
00166658
Vues:
12
>>** 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.

Actually, you should have SELECT CUSTOMER instead of SELECT COLLAT. You should probably have:
SELECT customer
SET ORDER TO TAG cid_cseq
SEEK m.CustID
SCAN WHILE cust_id = m.cust_id
      SELECT oTemp
      LOCATE FOR cust_seq = customer.cust_seq
      IF eof()
         loop
      ENDIF
      SCATTER MEMVAR MEMO
      SELECT customer
      GATHER MEMVAR MEMO
ENDSCAN
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform