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

Leaving a Method from a Class...

Hi,

how can i leave a method inside a class like this method, without
executing any further code...

example:

the method signature is : private void AnyMethod();
Something like that:

private void AnyMethod(){

if(CONDITION){
//Leave complete method
}

}
Thanks in advance...
Best Regards
Kerem Gümrükcü
Nov 16 '05 #1
5 1185
"Kerem Gümrükcü" <ka*******@hotmail.com> wrote in
news:#p**************@TK2MSFTNGP10.phx.gbl:
Hi,

how can i leave a method inside a class like this method, without
executing any further code...

example:

the method signature is : private void AnyMethod();
Something like that:

private void AnyMethod(){

if(CONDITION){
//Leave complete method
}

}


Kerem

if (CONDITION)
{
return;
}

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 16 '05 #2
"Kerem Gümrükcü" wrote:
how can i leave a method inside a class like this method, without
executing any further code...


return;

--

www.midnightbeach.com
Nov 16 '05 #3
Hi,

oh this is soo painfull, and i am a experienced programmer...you wont belive
that!
Thanks

Kerem Gümrükcü
Nov 16 '05 #4
Sure we believe it. There are days that my mind gets so numb with this
stuff that I have to look at my driver's license to see what my name is.

DalePres

"Kerem Gümrükcü" <ka*******@hotmail.com> wrote in message
news:OX**************@TK2MSFTNGP14.phx.gbl...
Hi,

oh this is soo painfull, and i am a experienced programmer...you wont
belive that!
Thanks

Kerem Gümrükcü

Nov 16 '05 #5
DalePres wrote:
Sure we believe it. There are days that my mind gets so numb with this
stuff that I have to look at my driver's license to see what my name is.
Heh... you copying me! :)

DalePres

"Kerem Gümrükcü" <ka*******@hotmail.com> wrote in message
news:OX**************@TK2MSFTNGP14.phx.gbl...
Hi,

oh this is soo painfull, and i am a experienced programmer...you wont
belive that!
Thanks

Kerem Gümrükcü



Nov 16 '05 #6

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

Similar topics

11
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected:...
4
by: daniel.w.gelder | last post by:
I wrote a template class that takes a function prototype and lets you store and call a C-level function, like this: inline string SampleFunction(int, bool) {..} functor<string (int, bool)>...
8
by: Zvonko | last post by:
Hi! Is it possible to capture an event when user leaves the page and execute some code? Not when he closes the window. Any ideas?
5
by: kuvpatel | last post by:
Hi I want to refer a class called LogEvent, and use one of its methods called WriteMessage without actually having to create an instance of Logevent. I have tried using the word sealed with...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
3
by: Peter J Ross | last post by:
Greetings. I'm quite new to PHP and have very little knowledge of programming in general, so I may be missing something obvious, but I can't find a solution to the following difficulty in either...
9
by: Matt | last post by:
In many places in my application, I have a DataGridView which users can either enter data into or use as a method of navigation in a master/detail form view. I need a method of stopping the user...
1
by: Anonymous | last post by:
Which is the correct approach to disable buttons when leaving an aspnet page? Currently I have the following html, which disables buttons when pressing F5 in FireFox, which ofcourse can occur...
4
by: daveh551 | last post by:
Okay, I feel like this is probably a stupid question, but... I have accessed sites that are pushing some scam that, when you go to leave the page it will pop up a box saying, "No, don't go, let...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.