Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace number
Message
De
13/04/2006 06:57:25
 
 
À
13/04/2006 06:33:48
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:
01113314
Vues:
14
Sure - sure. And Tore and others. Just look at how much simpler it is.

>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
>>>>
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform