Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find code from 10 fields
Message
De
07/08/2006 10:15:03
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01143440
Message ID:
01143449
Vues:
7
>>Dear Experts
>>
>>Table1 has 10 numeric fields named Filed1,Field2,Field3 and so on to Field10.
>>The code=1301002 is located in some fields.
>>I want to replace it with 1501002,
>>
>>How to findout code=1301002 from whole table?
>>Table1 has no index order set.
>>
>>Please help
>
>
FOR mycount = 1 TO 10
>    curfield = "Field"+TRANSFORM(m.mycount)
>    REPLACE &curfield WITH 1501002 FOR &curfield = 1301002 ALL IN Table1
>NEXT
My response would be very similar to yours:
FOR mycount = 1 TO 10
    lcCmd = ;
      Field(m.mycount) ;
      + " WITH 1501002 FOR " ;
      + Field(m.mycount) ;
      + " = 1301002 "
    REPLACE &lcCmd. IN Table1
NEXT
The help says ALL means all records in the table. The FOR is limiting the records, so you're not doing all. ALL is therefore not required.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform