Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace number
Message
De
13/04/2006 06:33:48
 
 
À
13/04/2006 06:13:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01113267
Message ID:
01113309
Vues:
17
hi,
We've pointed this out to you in the past. :-)are you sure, i don't remmeber :)

thanks.
>>hi,
>>thank you,
>>i got fantastic code from MR Michel Fournier
>>
>>replace all no with recno()
>>
>>thanks.
>
>Yes I know. I'm just guiding you on best practice for when you DO NEED a loop. Your code was over-complicated and not needed, and there's a better way to write it. We've pointed this out to you in the past. :-)
>
>>
>>
>>
>>>>hi,
>>>>thank you very much,fantastic
>>>>save time and code.
>>>>i try as under it works but bad way.
>>>>
>>>>USE bill_value
>>>>GO top
>>>>m.no=1
>>>>
>>>>DO WHILE .t. AND !EOF()
>>>>replace no WITH m.no
>>>>skip
>>>>m.no=m.no+1
>>>>IF EOF()
>>>>EXIT
>>>>ENDIF
>>>>enddo
>>>
>>>Even IF it was the way to go, M, you're STILL using that a old-old loop construct.  Much better is:
>>>
>>><pre>
>>>SCAN
>>>  replace no WITH m.no
>>>  m.no=m.no+1
>>>End SCAN
>>>
>>>
>>>and even the way you had it there was unneeded code:
>>>
>>>
>>>DO WHILE !EOF()
>>>  replace no WITH m.no
>>>  skip
>>>  m.no=m.no+1
>>>enddo
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform