473,385 Members | 1,693 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,385 software developers and data experts.

continue

Anyone else wish Vb.Net had a continue keyword such as
that in C based languages? It would be nice to send
execution to the begining of the loop without having
to 'GoTo'.
Nov 20 '05 #1
9 1794
"Dave" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
Anyone else wish Vb.Net had a continue keyword such as
that in C based languages? It would be nice to send
execution to the begining of the loop without having
to 'GoTo'.


What exactly are you trying to do? Loops in VB don't need a GoTo:

For Each obj in AnyCollection
....
Next

For i = 0 to 10
....
Next

Do While i < 10
....
Loop

While i<10
....
End While

--
Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
Nov 20 '05 #2
Cor
Hi Dave,
As far as I know is this old Cobol statement not implemented in VB.net
Cor
Nov 20 '05 #3
* "Dave" <an*******@discussions.microsoft.com> scripsit:
Anyone else wish Vb.Net had a continue keyword such as
that in C based languages? It would be nice to send
execution to the begining of the loop without having
to 'GoTo'.


In a weblog I read that they will introduce it in Whidbey. Maybe it's
rumor, I don't know.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #4
Hi Mike,

Here's just one format.

For Each Foo in LotsOfFoos
Select Foo.Number
Case 1:
DoSomethingAmazing
Continue
Case 2:
DoSomethingSpecial
Continue
Case 3:
DoSomethingDaft
Case 4:
DoSomethingFunny
End Select
DoSomethingSerious '3 and 4
Next

The use of Continue saves needing an If after the Select in order to
ensure that only 3 and 4 get serious.

It also makes it perfectly clear that 1 and 2 have just a single role
within the For loop.

Regards,
Fergus
Nov 20 '05 #5
On 28 Oct 2003 23:08:31 +0100, Herfried K. Wagner [MVP] wrote:

In a weblog I read that they will introduce it in Whidbey. Maybe it's
rumor, I don't know.


At the longhorn SDK site:

http://longhorn.msdn.microsoft.com/

They have the VB.Net specs but I think they have not been updated with the
new features, because there is no mention of generics or partial types on
that spec, even though the corresponding C# spec does list those things.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #6
Dave,
Whidbey is slated to support the Continue keyword.

See the Language Enhancements document at:

http://msdn.microsoft.com/vbasic/whidbey/

You may also want to review the chapter on Generics for some other language
enhancements.

Hope this helps
Jay
"Dave" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
Anyone else wish Vb.Net had a continue keyword such as
that in C based languages? It would be nice to send
execution to the begining of the loop without having
to 'GoTo'.

Nov 20 '05 #7
On 28 Oct 2003 23:08:31 +0100, Herfried K. Wagner [MVP] wrote:
* "Dave" <an*******@discussions.microsoft.com> scripsit:
Anyone else wish Vb.Net had a continue keyword such as
that in C based languages? It would be nice to send
execution to the begining of the loop without having
to 'GoTo'.


In a weblog I read that they will introduce it in Whidbey. Maybe it's
rumor, I don't know.

;-)


At this location is information on the new version of Visual Basic:

http://msdn.microsoft.com/vbasic/whidbey/

It includes Generics, Operator Overloading, Unsigned Types, Using Block,
and the Continue Statement. It gives exmples of the Continue statement
like this:

Public Sub PeterPiper()
Dim s As Char() = "peter piper picked pickled peppers"
Dim i As Integer

For i = 0 To (s.Length() - 1)
'interested only in p's
If Not (s(i).Equals("p"c)) Then Continue For
s(i) = "P"c
Next
Console.WriteLine(s)
End Sub
And the Using Block:

Imports System.Drawing

Sub Main()
'Create a new font object using expensive system
'resources.
Using theFont As New Font("Arial", 10.0F)
txtFontA.Font = theFont
txtFontA.Text = "Hello Bebbe Cow!"
End Using
'The Dispose method has been called on our Font
'releasing the system resources.

'Repeat the process reading text from a file.
'Note that the filename is invalid in this case.
Dim sFilename As String = "C:\Invalid*Test*File"
Using theFont As New Font("Arial", 10.0F)
txtFontA.Font = theFont
'This will throw an exception because the filename is invalid
txtFontA.Text=My.Computer.FileSystem.ReadAllText(s Filename)
End Using
'The dispose method has been called even though
Ąthe code threw an exception.
End Sub
Very interesting and exciting changes for VB ahead!
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #8
* Chris Dunaway <dunawayc@_lunchmeat_sbcglobal.net> scripsit:
In a weblog I read that they will introduce it in Whidbey. Maybe it's
rumor, I don't know.

;-)


At this location is information on the new version of Visual Basic:

http://msdn.microsoft.com/vbasic/whidbey/

It includes Generics, Operator Overloading, Unsigned Types, Using Block,
and the Continue Statement. It gives exmples of the Continue statement
like this:


Thanks for providing the link.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
* "Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> scripsit:
Whidbey is slated to support the Continue keyword.


That means that they read our petitions here.

;-)))

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10

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

Similar topics

2
by: Michael Satterwhite | last post by:
I *MUST* be overlooking something obvious. Consider the following code: foreach($_POST as $key=>$value) { print "$key=>$value<br />"; if(! empty($value)) { switch($key) { case "Submit": case...
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
3
by: Jianli Shen | last post by:
const DInst *stopAtDst = 0; while (dinst->hasPending()) { if (stopAtDst == dinst->getFirstPending()) break; ///////break? break? break? is this break outof the whole while loop and...
14
by: Daniel Bass | last post by:
is there an equivalent key word for C++'s "continue" in VB (.net) in this context? CString szLine; szLine = myReader.ReadLine(); while ( !szLine.IsEmpty() ) { if ( szLine(0) == '-' ) {
2
by: buran | last post by:
Dear ASP.NET Programmers, I have a question about a script I'm trying to code and invoke when a button (btnSave) is pressed on the page. This script should only run when a textbox (txtAD) on the...
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...
12
by: William | last post by:
VB6 had the ability to pause your execution while debugging, messing with the code, and continue executing right from where you left off. Is DotNet ever going to have this capability? I really...
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; } }
13
by: xz | last post by:
What if I want the following: vector<intv; // v is loaded by push_back() switch( v.size() ) { case 2: //do something
36
by: mdh | last post by:
May I ask the group this somewhat non-focused question....having now seen "continue" used in some of the solutions I have worked on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind) Is there a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.