473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

vb.NET Missing a 'continue' statement in while loop?

Is this language missing the functionality of a C/C++ 'continue' statement?

For example:

While NOT isEof()
If condition
' a C or C++ continue would work here
' but we are forced to use a GoTo
GoTo nxt
End If
... more statements here ...
nxt:
End While

You CAN rewrite the code to get rid of the GoTo by adding an 'else' to
the If, but code complexity increases as you're nesting more code in
conditionals.

Nov 20 '05 #1
15 9120

"PagCal" <pa****@runbox.com> wrote in message
news:uN***************@tk2msftngp13.phx.gbl...
Is this language missing the functionality of a C/C++ 'continue'

statement?

Yes. We will get this with VB 2005. FINALLY!
Nov 20 '05 #2
* PagCal <pa****@runbox.com> scripsit:
Is this language missing the functionality of a C/C++ 'continue' statement?


Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue
<type of loop>' too.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...
Is this language missing the functionality of a C/C++ 'continue'
statement?
Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue
<type of loop>' too.


Really? I hadn't noticed that. So if you're in a For...Next loop nested
inside a Do While loop you can use Continue Do to completely exit the For
and iterate the Do?
Nov 20 '05 #4
It appears so... which gives us the 'edge'

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...
Is this language missing the functionality of a C/C++ 'continue'

statement?

Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue
<type of loop>' too.


Really? I hadn't noticed that. So if you're in a For...Next loop nested
inside a Do While loop you can use Continue Do to completely exit the For
and iterate the Do?

Nov 20 '05 #5
Jeff,

* "Jeff Johnson [MVP: VB]" <i.***@enough.spam> scripsit:
Is this language missing the functionality of a C/C++ 'continue'
statement?


Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue
<type of loop>' too.


Really? I hadn't noticed that. So if you're in a For...Next loop nested
inside a Do While loop you can use Continue Do to completely exit the For
and iterate the Do?


Yes :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
Having managed to completely avoid C and C++ (and C#) for nearly 11 years of
programming now.... can someone explain a bit more about the Continue
statement?? From this thread I just gathered it did the same as Exit
For??!!
____________________________
The Grim Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
It appears so... which gives us the 'edge'

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...
> Is this language missing the functionality of a C/C++ 'continue'

statement?

Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue <type of loop>' too.


Really? I hadn't noticed that. So if you're in a For...Next loop nested
inside a Do While loop you can use Continue Do to completely exit the For and iterate the Do?


Nov 20 '05 #7
Ever read Reaper Man? Fantastic story....

The Continue statement does not exit the for loop, it moves directly to the
next statement:

For I As Integer = 1 To 10
If I < 5 Then Continue For
MsgBox(I.ToString())
Next I

While the value of I is less than 5, the execution will jump to 'Next I'
bypassing all after it. When I is greater than or equal to 5, Continue For
will not be called, so execution will occurr as normal.

This also applies to a For Each statement:

For Each strString As String In SomeStringArray
If strString = "SomeValue" Then Continue For
MsgBox(strString)
Next
--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@hercules.btinternet.com...
Having managed to completely avoid C and C++ (and C#) for nearly 11 years of programming now.... can someone explain a bit more about the Continue
statement?? From this thread I just gathered it did the same as Exit
For??!!
____________________________
The Grim Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
It appears so... which gives us the 'edge'

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2l************@uni-berlin.de...

> > Is this language missing the functionality of a C/C++ 'continue'
statement?
>
> Up to version 2003, yes. In 2005, we will have 'Continue' and 'Continue > <type of loop>' too.

Really? I hadn't noticed that. So if you're in a For...Next loop nested inside a Do While loop you can use Continue Do to completely exit the For and iterate the Do?



Nov 20 '05 #8
Hi Grim, have you ever used the Cobol Alter statement, for me it is
something like that.

I read that we can be glad to get that kind of behaviour back.

:-(

Cor
Nov 20 '05 #9
Noooooooooooooooooooooooooooooooooooooo

Not the dreaded ALTER GOTO

Had to use that once to save 8 bytes of core memory :)
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi Grim, have you ever used the Cobol Alter statement, for me it is
something like that.

I read that we can be glad to get that kind of behaviour back.

:-(

Cor

Nov 20 '05 #10
* "Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> scripsit:
The Continue statement does not exit the for loop, it moves directly to the
next statement:

For I As Integer = 1 To 10
If I < 5 Then Continue For
MsgBox(I.ToString())
Next I


ACK. As mentioned before, you can jump to the next outer loop too:

\\\
Do While...
For...To...
If...Then Continue Do
Next...
Loop
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #11
On Sat, 10 Jul 2004 00:09:44 +1200, Stephany Young wrote:
Noooooooooooooooooooooooooooooooooooooo

Not the dreaded ALTER GOTO

Had to use that once to save 8 bytes of core memory :)
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi Grim, have you ever used the Cobol Alter statement, for me it is
something like that.


I remember learning COBOL in college, but I have never looked at it since.
(Thank Goodness!)

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 20 '05 #12
I remember learning Prolog in College :: shudder ::

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:15*****************************@40tude.net...
On Sat, 10 Jul 2004 00:09:44 +1200, Stephany Young wrote:
Noooooooooooooooooooooooooooooooooooooo

Not the dreaded ALTER GOTO

Had to use that once to save 8 bytes of core memory :)
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi Grim, have you ever used the Cobol Alter statement, for me it is
something like that.


I remember learning COBOL in college, but I have never looked at it since.
(Thank Goodness!)

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 20 '05 #13
Ahhh..... gotcha!! Sounds very useful.

I prefer Mort and Pyramids personally - but then I think they're all
fantastic :D
_______________________________
The Grimy Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Ever read Reaper Man? Fantastic story....

The Continue statement does not exit the for loop, it moves directly to the next statement:

For I As Integer = 1 To 10
If I < 5 Then Continue For
MsgBox(I.ToString())
Next I

While the value of I is less than 5, the execution will jump to 'Next I'
bypassing all after it. When I is greater than or equal to 5, Continue For
will not be called, so execution will occurr as normal.

This also applies to a For Each statement:

For Each strString As String In SomeStringArray
If strString = "SomeValue" Then Continue For
MsgBox(strString)
Next
--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@hercules.btinternet.com...
Having managed to completely avoid C and C++ (and C#) for nearly 11 years
of
programming now.... can someone explain a bit more about the Continue
statement?? From this thread I just gathered it did the same as Exit
For??!!
____________________________
The Grim Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
It appears so... which gives us the 'edge'

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...
>
> "Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message > news:2l************@uni-berlin.de...
>
> > > Is this language missing the functionality of a C/C++ 'continue'
> statement?
> >
> > Up to version 2003, yes. In 2005, we will have 'Continue' and

'Continue
> > <type of loop>' too.
>
> Really? I hadn't noticed that. So if you're in a For...Next loop nested > inside a Do While loop you can use Continue Do to completely exit

the For
> and iterate the Do?
>
>



Nov 20 '05 #14
My history.... (hold your breath....)

Commodore 64 Basic (can't even remember what it was called!!)
BBC Basic (again.. vague recollection...)
QBasic
AmigaBasic
BlitzBasic
Back to QBasic
VB6
VB.NET

I'm somehow managed to completely avoid C, C++ and C#, while learning god
knows how many ladder logic languages, Spanish and the Speak Of Woman.
Although still not fluent in that one.
_______________________________
The Grim Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:uC*************@TK2MSFTNGP11.phx.gbl...
I remember learning Prolog in College :: shudder ::

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:15*****************************@40tude.net...
On Sat, 10 Jul 2004 00:09:44 +1200, Stephany Young wrote:
Noooooooooooooooooooooooooooooooooooooo

Not the dreaded ALTER GOTO

Had to use that once to save 8 bytes of core memory :)
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
> Hi Grim, have you ever used the Cobol Alter statement, for me it is
> something like that.
>


I remember learning COBOL in college, but I have never looked at it since. (Thank Goodness!)

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.


Nov 20 '05 #15
lol. My history is very similar.
Only replace BlitzBasic with Assembly, ANSI C, then insert VB3, 4, and 5
(although not sure it officially made it out of Beta).
VIC 20 Basic
PET Basic / CPM
Commodore 64/128 Basic
QBasic
AmigaBasic
Assembly
ANSI C
Fortran
MDL (MicroStation Development Language "C" like)
VB3, VB4, VB5, VB6 (Although I think VB5 barely made it out of Beta)
MBE MicroStation Basic
VB.Net + C# only when VB won't do something I need.

Somehow I have managed to get by without ever having to learn C++, or Java.

Gerald

"The Grim Reaper" <gr*********@btopenworld.com> wrote in message
news:cc**********@titan.btinternet.com...
My history.... (hold your breath....)

Commodore 64 Basic (can't even remember what it was called!!)
BBC Basic (again.. vague recollection...)
QBasic
AmigaBasic
BlitzBasic
Back to QBasic
VB6
VB.NET

I'm somehow managed to completely avoid C, C++ and C#, while learning god
knows how many ladder logic languages, Spanish and the Speak Of Woman.
Although still not fluent in that one.
_______________________________
The Grim Reaper

"Tom Spink" <thomasdotspinkatsp@mntlworlddotcom> wrote in message
news:uC*************@TK2MSFTNGP11.phx.gbl...
I remember learning Prolog in College :: shudder ::

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:15*****************************@40tude.net...
On Sat, 10 Jul 2004 00:09:44 +1200, Stephany Young wrote:

> Noooooooooooooooooooooooooooooooooooooo
>
> Not the dreaded ALTER GOTO
>
> Had to use that once to save 8 bytes of core memory :)
>
>
> "Cor Ligthert" <no**********@planet.nl> wrote in message
> news:%2***************@TK2MSFTNGP11.phx.gbl...
>> Hi Grim, have you ever used the Cobol Alter statement, for me it is
>> something like that.
>>

I remember learning COBOL in college, but I have never looked at it since. (Thank Goodness!)

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.



Nov 20 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: JS | last post by:
#include <stdio.h> main(){ int c, i, nwhite, nother; int ndigit; nwhite = nother = 0; for (i = 0; i < 10; ++i)
7
by: ssantamariagarcia | last post by:
I have found a problem while using a while statement and a linked list. I had never met this matter before....and I am wondering that if you have , please tell me what it is wrong. I am...
6
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
1
by: rlm | last post by:
When I attempt to manage Transactions in a WHILE LOOP @@TRANCOUNT is off. I obviously do not understand error handling as I should. In the loop below where does the point of execution move to after...
14
by: Jan Schmidt | last post by:
Hi, in a nested do-while-loop structure I would like to "continue" the outer loop. With goto this should be no problem in while-loops. However, for do-while I cannot get it to work (without a...
11
by: Rene | last post by:
Quick question, what is the point for forcing the semicolon at the end of the while statement? See example below: x = 0; do { x = x + 1; }while (x < 3); What's the point of having the...
3
by: Darin | last post by:
i have a do while loop that within it has a select statement. Some of the items are done some of the times, others are done all the time. I would like either: Do while not_done if quick and...
2
by: Kakashi | last post by:
My problem is when I try to run the while loop that is nested in the do while loop it fails to even enter into it. Am I missing something here, I do not have any errors or anything. The try catch...
3
by: Paulo Santos | last post by:
First of all, it's my first time here. Also, i'm working on a simple rent management program for a school project. I've fixed most of the errors but i'm lost on what could be wrong here: error:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.