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

next / next x difference

I've tried testing this to see if there is any difference but couldn't find
any... is there any difference in doing a For - Next loop with/without a
value after the 'Next' at the end?

e.g. -->
For x in 1 to 10
'statements
Next

versus

For x in 1 to 10
'statements
Next x

thx for any help.

[VB.NET 2003 / .NET 1.1]

Jan 14 '06 #1
3 1235
"new q." <no****@nomail.com> schrieb:
I've tried testing this to see if there is any difference but couldn't
find
any... is there any difference in doing a For - Next loop with/without
a
value after the 'Next' at the end?


No.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 14 '06 #2

readability perhaps ?? although it confused me when i saw it the first
time

regards

Michel Posseth [MCP]

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O1**************@TK2MSFTNGP14.phx.gbl...
"new q." <no****@nomail.com> schrieb:
I've tried testing this to see if there is any difference but couldn't
find
any... is there any difference in doing a For - Next loop with/without
a
value after the 'Next' at the end?


No.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 14 '06 #3
"m.posseth" <mi*****@nohausystems.nl> schrieb:
readability perhaps ?? although it confused me when i saw it the first
time


Personally I prefer 'Next <variable name>' because it's more
self-documenting. However, unfortunately VS.NET 2003 doesn't automatically
rename the variable in the 'Next' line if the loop variable gets renamed,
which will reduce maintainability of the code.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 14 '06 #4

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

Similar topics

2
by: Wonko | last post by:
Here's my problem if anyone could be so kind to help me out. I assume it's quite easy for an experienced programmer but I'm not one of them :) I have a JavaScript code that: - displays multiple...
8
by: Alex | last post by:
ACC 2000 I am having problems working out how to adding up minutes? Example:using short time Date Timestart Timend Minutes 25-jan-04 15:00 16:00 60
48
by: Wade Yin | last post by:
Hi, What's the difference between: char *x="abcde"; and char y={"abcde"};
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
8
by: jvb | last post by:
Hey all, I figure it's Wednesday, why not put a question up for debate. Beyond personal preference, is there any benefit (performance or otherwise) to using one loop over the other? For example,...
3
by: bob.needler | last post by:
I know On Error Resume Next is generally considered lazy. But can someone tell me why the resume next in Exit_Handler does not seem to work? It generates the typical unhandled runtime error...
2
by: Dan | last post by:
Hi, I use the logon control for logging into the application. When logging and checking the option "remember me next time" and then closing the browser without to press any logout button which...
4
by: Pachalo | last post by:
Morning... Am working on a simple billing system and a looking for a code that can help calculate the difference in time between sessions..(am using VB.Net ) This is what is happening: l...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.