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

how to exit?

strSQL = Server.MapPath("remessa\\") + "CSG" +
(DateTime.Now.Year.ToString().Substring(DateTime.N ow.Year.ToString().Length
- 1) + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00"));

for (int i = 1; i < 1000; i++)
{
if (!File.Exists(strSQL + i.ToString("000") + ".rem"))
{
sNomeFile = strSQL + i.ToString("000") + ".rem";
return for / exit for; //??????????????????????????????
}
}

Hi,

How to 'exit for' when such condition above?

VS 2005 asp.net C# 2.0

Thanks a lot
Oct 31 '07 #1
3 1440
try

break;
"Paulo" <pr*****@uol.com.brwrote in message
news:uk*************@TK2MSFTNGP05.phx.gbl...
strSQL = Server.MapPath("remessa\\") + "CSG" +
(DateTime.Now.Year.ToString().Substring(DateTime.N ow.Year.ToString().Length
- 1) + DateTime.Now.Month.ToString("00") +
DateTime.Now.Day.ToString("00"));

for (int i = 1; i < 1000; i++)
{
if (!File.Exists(strSQL + i.ToString("000") + ".rem"))
{
sNomeFile = strSQL + i.ToString("000") + ".rem";
return for / exit for; //??????????????????????????????
}
}

Hi,

How to 'exit for' when such condition above?

VS 2005 asp.net C# 2.0

Thanks a lot

Oct 31 '07 #2
"Paulo" <pr*****@uol.com.brwrote in message
news:uk*************@TK2MSFTNGP05.phx.gbl...

if (!File.Exists(strSQL + i.ToString("000") + ".rem"))
{
sNomeFile = strSQL + i.ToString("000") + ".rem";
break;
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 31 '07 #3
or or those structured code followers that do not allow use of a break
or a return:
for ( int i=0;
i < 1000 && File.Exists(strSQL + i.ToString("000") + ".rem");
++i
)
{
// do something
}

-- bruce (sqlwork.com)

Mark Rae [MVP] wrote:
"Paulo" <pr*****@uol.com.brwrote in message
news:uk*************@TK2MSFTNGP05.phx.gbl...

if (!File.Exists(strSQL + i.ToString("000") + ".rem"))
{
sNomeFile = strSQL + i.ToString("000") + ".rem";
break;
}

Nov 1 '07 #4

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

Similar topics

12
by: Ivan Voras | last post by:
In a code such as: if len(sys.argv) < 2: print "I need arguments!" sys.exit(1) Is sys.exit() really a good choice? Is there something more elegant? (I tried return but it is valid only in a...
1
by: Guinness Mann | last post by:
Pardon me if this is not the optimum newsgroup for this post, but it's the only .NET newsgroup I read and I'm certain someone here can help me. I have a C# program that checks for an error...
1
by: Brendan Miller | last post by:
I am trying to close my application using Application.exit() in the frmMain_Closing event. When the form closes the process does not. My application only has one form (no other classes either). ...
4
by: Bob Day | last post by:
Using VS 2003, VB.net... I am confused about the Application.Exit method, where the help states "This method does not force the application to exit." Aside from the naming confusion, how do I...
1
by: =?Utf-8?B?VGFvZ2U=?= | last post by:
Hi All, When I use applcation.exit() in winForm application, the form closed, but the process is still going!! ( The debug process is still running if debug in VS IDE). Environment.Exit(0) works...
16
by: Laurent Deniau | last post by:
I would like to know if the use of the pointer ref in the function cleanup() below is valid or if something in the norm prevents this kind of cross-reference during exit(). I haven't seen anything...
11
by: yawnmoth | last post by:
To quote from <http://php.net/function.include>, "Because include() is a special language construct, parentheses are not needed around its argument. Take care when comparing return value." ...
11
by: =?Utf-8?B?U3RldmVEQjE=?= | last post by:
Hi all. I'm using VS 2008 Express C++. I created a console application back in 1999, and updated it for VC++ 6.0 in 2001. I've updated again this past month, and have found enough differences...
39
by: mathieu | last post by:
Hi there, I am trying to reuse a piece of code that was designed as an application. The code is covered with 'exit' calls. I would like to reuse it as a library. For that I renamed the 'main'...
0
by: Gary Robinson | last post by:
In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() But I don't see exit() mentioned as a built-in function; rather the Python Library Reference says we...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.