How to exit from a function in C#? Like "exit sub in VB"

Teixeira
02-02-2005, 04:57 AM
Hi all,

I would like to know how can I exit from a function on loop statement.
In vb i used to write exit function, exit sub..... and it worked well, but in C# these option doesn't exists (I think).

In a method for example

private void IniciaInspec_Click(object sender, System.EventArgs e)


I saw some examples but in functions that returned a bool value and if we made the return false/true; it exit, but in this case i have a void method reserved to the event of button click, how can I make this?

Thanks

Teixeira

Teixeira
02-02-2005, 08:16 AM
I got it myself with a research in google.

Is just return;

as the sub is void we return void too

Thanks fo those wo read this post to helpme.

Teixeira

DJ_Klepc
02-02-2005, 08:36 AM
I knew that return is correct answer, but i was not sure, because i don't have C# installed! :D

Probably there is many C++ functions in C#. C# = VB(designing) + C++(coding)

Kalkran
02-10-2005, 12:37 PM
lol its the same in C and C++ :)
C++ / C ROCKS! Now I just need to learn it ;)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum