Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a FOR LOOP with reccount()
Message
De
09/09/1998 15:13:03
 
 
À
09/09/1998 13:20:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00134627
Message ID:
00134741
Vues:
15
>Hi Robert ---
>
>Are you trying to replace myfld with the recordnumber? Or just a unique number?
>If the record number:
>
>REPLACE ALL myfld WITH RECNO()
>
>If a unique number (a counter):
>
>n=1
>SCAN
>   REPLACE myfld WITH n
>   n=n+1
>ENDSCAN
>
>OK?
>
>>The reccount() is not working.
>>Here is my code:
>>
>>i=1
>>for i=1 to reccount()
>> replace myfld with i
>> if !eof()
>> skip
>> endif
>>endfor
>>
>>What I want to do is change the value of myfld in all the records in the table. This FOR LOOP will not do that.
>>any ideas?


Just a word of caution...REPLACE ALL does an implicit file lock, so if the table is large and being updated by several people, you'll have problems.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform