-
November 2nd, 2004, 12:27 PM
#1
How to write a while loop in VB ?
i see these:
Code:
Do While <condition>
'code
Loop
Do
'code
Loop While <condition>
Do Until <condition>
'code
Loop
Do
'code
Loop Until <condition>
While <condition>
'code
Wend
While <condition>
'code
End While
note.. this is from memory so some things might be the wrong way round.. can someone tell me what is the form of a while loop? at the moment i do While/Wend but if this is old style (like saying Call <function>) then i'll switch.. just need an authoritative statement
cheers
-
November 2nd, 2004, 04:25 PM
#2
Re: How to write a while loop in VB ?
while/wend isn't valid in vb.net, but the ide (visual studio 2003 at least) auto-converts it to End While. but you probably already knew that
-
November 2nd, 2004, 06:43 PM
#3
Re: How to write a while loop in VB ?
There is no single "correct" way to do it. It just depends on what you need.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
November 2nd, 2004, 08:26 PM
#4
Re: How to write a while loop in VB ?
They are all equivalent, only, you can't do Exit Do (or Exit While) in a while wend loop, so I believe it make it easier to read and understand as there is only one condition to exit.
JeffB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|