Solved

Exit Function

Posted on 2006-06-12
3
4,720 Views
Last Modified: 2012-06-21
Can anyone give me the equivalent command for Exit Function or Exit Sub in C#?

Regards
Pradeep
0
Comment
Question by:pradeepsudharsan
3 Comments
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 25 total points
ID: 16891970
Use "return"...

        private void button1_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("the code below");

            return;

            Debug.WriteLine("will never be reached...");
        }
0
 
LVL 7

Author Comment

by:pradeepsudharsan
ID: 16891983
any other command?
0
 
LVL 5

Accepted Solution

by:
t_itanium earned 25 total points
ID: 16892268
yes you can do that by another way around :)

 private void button1_Click(object sender, EventArgs e)
{
            MessageBox.Show("it is displayed");

            goto end;

            MessageBox.Show("it is not displayed");

            end: {}
 }

when reaching the goto function it will go to the end of the function and end it...

cheers
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question