Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Please explain 'DO WHILE .T.'
Message
De
23/12/1999 12:42:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00307982
Message ID:
00308017
Vues:
27
>Relative newbie question....
>
>I'm supporting a VFP6 app written by a developer who was familiar with FPW 2.6 and never really took the time to get up to speed on VFP6. In several places, he uses the DO WHILE .T. .... ENDDO construct.
>
>Hacker's Guide describes it as being a poor programming practice, but doesn't explain the logic. Help has an example in the DO WHILE article, but doesn't explain what is being tested for a .T. condition.
>
>My problem is in thinking through the logic. What is the condition being evaluated, and when does it evaluate to .T. or .F.?
>
>Can someone please enlighten me?
>

It's a "DO FOREVER" loop. Presumably, you have something that can't be evaluated either just before first execution (resulting in 0 or more repetitions, a classical DO WHILE) or immediately following the first execution (resulting in at least one repetition, what would be a DO UNTIL, where we test after performing the operation). In almost all cases where people use DO WHILE .T., there's an IF statement with an EXIT in the middle of the loop; you could recode the loop to use DO WHILE condition instead.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform