Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do...[Statements] while [boolean] as in C#'.Net
Message
From
23/02/2007 11:58:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Do...[Statements] while [boolean] as in C#'.Net
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01198353
Message ID:
01198353
Views:
52
Is there any type of loops statement in VFP which will evaluate the condition AFTER each iteration, rather than at the start of the loop? C#.Net has the "While" Statement, which is similar to VFP's "Do While". But C# also has the DO statement as in:

Do (statement(s)) while(booleanexpression) so that the statements are ran at least ONCE regardless of the value of the boolean expression.

Out of habit, and because I've never known any other way/work-around in VFP, I've done the following:

"Primer" the Do while first with (some list of statements)

Do while (lexpression)
(do the same statements above that I used to primer this do while loop, sometimes duplicating code, uggh.)
enddo

How do others out there do this? After working in C#, it seems that there must be a better way in VFP that I've never learned...Some sort of OOP implementation so that there is no duplicate code? I hope I'm making sense with my question here.

TIA for your input.
Next
Reply
Map
View

Click here to load this message in the networking platform