473,406 Members | 2,293 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,406 software developers and data experts.

Loop continue

What is loop continue in VB?
Loke in C#:
for (int i=0; i<10; i++)
{
if (i==7)
continue;
...
}
Nov 21 '05 #1
4 4824
VB 2005 has "Continue For", but the following (produced with our Instant VB
C# to VB.NET converter) is the equivalent in VB 2002/2003 - not very pretty
with the goto but it is the equivalent:

For i As Integer = 0 To 9
If i=7 Then
GoTo Continue1
End If
...
Continue1:
Next i

--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
"David Dvali" wrote:
What is loop continue in VB?
Loke in C#:
for (int i=0; i<10; i++)
{
if (i==7)
continue;
...
}

Nov 21 '05 #2

"David Dvali" <da*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is loop continue in VB?
Loke in C#:
for (int i=0; i<10; i++)
{
if (i==7)
continue;
...
}


Could be something like the following (w/o goto's involved), other than that
(and w/o goto's) there isn't much of an equivalent to C's continue.

for (int i = 0; i < 10; i++) {
if (i != 7) {
... code to run when not continuing.
}
}

Basically, instead of continue, you'd have to rewrite your logic to just not
run the code if the condition is not met...

Mythran

Nov 21 '05 #3
Hi David

There is no equivalent. Continue is unstructured, so you need to alter the
logic to be structured, for example

For i As Integer = 0 To 9
If i <>7 Then
...
End If
Next i

HTH

Charles
"David Dvali" <da*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is loop continue in VB?
Loke in C#:
for (int i=0; i<10; i++)
{
if (i==7)
continue;
...
}

Nov 21 '05 #4

Continue is considered structured. It has a very specific meaning - jump to
the end of the loop and follow the instruction there. If there is a "GO" in
the middle, do not pass it and do not collect $200.

Mike Ober.

"Charles Law" <bl***@nowhere.com> wrote in message
news:uX*************@TK2MSFTNGP15.phx.gbl...

Hi David

There is no equivalent. Continue is unstructured, so you need to alter the
logic to be structured, for example

For i As Integer = 0 To 9
If i <>7 Then
...
End If
Next i

HTH

Charles
"David Dvali" <da*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is loop continue in VB?
Loke in C#:
for (int i=0; i<10; i++)
{
if (i==7)
continue;
...
}



Nov 21 '05 #5

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

Similar topics

5
by: Glen Wheeler | last post by:
Hello All. I've been coding in python for a reasonable amount of time now (coding in total for approx. 20 years) and am writing a performance intensive program in python. The problem I'm having...
5
by: Ann | last post by:
I have trouble sometimes figuring out where break and continue go to. Is there some easy way to figure it out, or a tool? TIA Ann
1
by: Brian Burgess | last post by:
Hi, Any one know how to go to the beginning of the Next iteration of a For Loop? Similar to a c-style 'continue'? Many thx in advance.. -BB
15
by: PagCal | last post by:
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...
32
by: cj | last post by:
When I'm inside a do while loop sometimes it's necessary to jump out of the loop using exit do. I'm also used to being able to jump back and begin the loop again. Not sure which language my...
1
by: Danny M | last post by:
What i want to do is this: I have a loop of records. For some records the user need to give some feedback Because of this i want to open a modal form in the loop When the user clicks a button...
25
by: v4vijayakumar | last post by:
'continue' within switch actually associated with the outer 'while' loop. Is this behavior protable? int ch = '\n'; while (true) { switch(ch) { case '\n': cout << "test"; continue; } }
8
by: Nasutperaah | last post by:
Hi all, I have written a C ++ program and now need to add a way to make it exit on command, or start over from the beginning. I have very little programming knowledge; Here is my code: Thanks in...
2
by: lSugaRushl | last post by:
Hey all. New to the forum. Is there a way to make a loop continue until an input is entered? i've tried the - if (cin.peek() == '\n') {} - but it stays there til an input is added, just...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.