|
-
Dec 27th, 2001, 09:06 PM
#1
Thread Starter
Member
-
Dec 27th, 2001, 09:09 PM
#2
-
Dec 27th, 2001, 09:15 PM
#3
-
Dec 27th, 2001, 09:24 PM
#4
Member
You can also exit a function or sub with that keyword, so the complete list (according to the VB5 help) is:
VB Code:
Exit Do
Exit For
Exit Function
Exit Property
Exit Sub
Exit While ' they forgot that
-
Dec 27th, 2001, 09:27 PM
#5
Originally posted by filburt1
VB Code:
Exit While ' they forgot that
No I didn't
-
Dec 27th, 2001, 09:29 PM
#6
Member
I mean the VB5 help did.
-
Dec 28th, 2001, 01:40 AM
#7
Hyperactive Member
Too bad, Exit While no longer works in VB6
-
Dec 28th, 2001, 01:49 AM
#8
Well use a Do While loop instead then.
-
Dec 28th, 2001, 02:01 AM
#9
Hyperactive Member
Yes, I've always use DO WHILE loop, instead of WHILE WEND loop. Wondering, is there any difference other than the ability to exit loop.
Harddisk
-
Dec 28th, 2001, 02:03 AM
#10
Originally posted by Harddisk
Yes, I've always use DO WHILE loop, instead of WHILE WEND loop. Wondering, is there any difference other than the ability to exit loop.
Harddisk
The main difference is of course that you can put the While statement at the end of the loop and by doing that the loop will execute at least once.
-
Dec 28th, 2001, 11:31 AM
#11
Member
Why would they kill the While-Wend loop? It's probably one of the most useful ones in any language.
-
Dec 28th, 2001, 12:22 PM
#12
Hyperactive Member
Originally posted by filburt1
Why would they kill the While-Wend loop? It's probably one of the most useful ones in any language.
filburt1, While Wend is still available, except that you are not able to exit/break from the loop halfway running it.
-
Dec 29th, 2001, 08:06 PM
#13
Originally posted by filburt1
Why would they kill the While-Wend loop? It's probably one of the most useful ones in any language.
The While ... Wend loop is actually sort of depricated. You can always use a Do While .... Loop iteration instead.
BTW it has changed in VB.Net to While ... End While to be more like any other block statements in VB.
Best regards
-
Dec 29th, 2001, 09:04 PM
#14
Member
But as pointed out the two loops have different purposes; even in C++ and Java there's:
Code:
do
{
} while (condition);
// and
while (condition)
{
}
So do both loops still exist in VB.Net?
-
Dec 29th, 2001, 09:37 PM
#15
PowerPoster
Also yahs forgot the
Do Until
and
Loop Until
Example:
Do until a=5
Loop Until a=5
The difference is very small. If you use DO Until then the code will run one last time. If you use loop until it will stop looping immediately.
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Dec 30th, 2001, 07:30 AM
#16
Originally posted by filburt1
But as pointed out the two loops have different purposes; even in C++ and Java there's:
Code:
do
{
} while (condition);
// and
while (condition)
{
}
So do both loops still exist in VB.Net?
In VB you can use a Do loop for both cases.
VB Code:
Do While condition
'this is exactly like a While ... WEnd loop
Loop
'or
Do
'...
Loop While condition
Both of these still exists in VB.Net. I as I already mentioned the other While loop still exists it just changed from WEnd to While End.
VB Code:
'VB.Net code
While condition
'...
End While
Do Until is the exact same thing as Do While Not, it's just a preference of how you want to type it.
Best regards
Last edited by Joacim Andersson; Dec 30th, 2001 at 07:33 AM.
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
|