Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dupe records? What's up with SCAN FOR command?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Dupe records? What's up with SCAN FOR command?
Divers
Thread ID:
00692395
Message ID:
00692395
Vues:
57
I think this is an easy one, but I have yet to figure it out.

See the following code in my Form Init. The code scans records in a master table and adds records to a sub table if they are not already in the sub table.

Whenever I run the form it adds records to sub table even if records already in sub table? Something is wrong with the SCAN FOR command. Thanks.


IF !USED("surv_sca")
USE \data\registry\surv_sca IN 0 SHARED
ENDIF
SELECT surv_sca
SET ORDER TO mast_id

USE \data\registry\master IN 0 SHARED
SELECT master
SET ORDER TO mast_id
SCAN FOR master.mast_id<>surv_sca.mast_id AND ;
!EMPTY(master.msca_close) AND ;
!EMPTY(master.msca_id) AND ;
!EMPTY(master.disto) AND ;
master.date+30 < DATE()
SELECT surv_sca
APPEND BLANK
REPLACE surv_sca.mast_id WITH master.mast_id
REPLACE surv_sca.run_num WITH master.incident
REPLACE surv_sca.run_date WITH master.date
REPLACE surv_sca.name_last WITH master.name_last
REPLACE surv_sca.name_first WITH master.name_first
REPLACE surv_sca.phone_num WITH master.phone
SELECT master
ENDSCAN
<\pre>
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform