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

HOW TO INTERRUPT A SUBRUTINE?

Happy Holidays!

To exit a subrutine I use Exit Sub in VB. Is there something similar in C#?

Thanks!!!

Raul
Nov 16 '05 #1
4 1331

"Raul M. Colon" <Ra********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Happy Holidays!

To exit a subrutine I use Exit Sub in VB. Is there something similar in
C#?


yes, 'return'.

Nov 16 '05 #2
Im not sure of other possible commands, but "Return" will probably work

Subroutine? Whats that?

If youre in a function thats declared as a void return, when it exits it
probably returns with zero then ignores the zero;
But you simply finish your subroutine with the last line of code and Exit
Sub is assumed? (Im assuming?)

Otherwise if you want to break out, it seems to me a "Return" should do it
"Raul M. Colon" <Ra********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Happy Holidays!

To exit a subrutine I use Exit Sub in VB. Is there something similar in C#?
Thanks!!!

Raul

Nov 16 '05 #3
If it doesn't return any values (i.e. it is a void method) then you can
simply use "return" to exit the method. If it does return a value though
then you'll have to specify something after the return keyword. In most
cases there is a default value that you can return - for example if it's a
boolean method you might want to return false by default. It really depends
on what the subroutine does.
~amit

"Raul M. Colon" <Ra********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Happy Holidays!

To exit a subrutine I use Exit Sub in VB. Is there something similar in C#?
Thanks!!!

Raul

Nov 16 '05 #4
Thanks for your help... 'return' did it.
I'm new in C#, trying to switch from VB.
Nov 16 '05 #5

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

Similar topics

19
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException....
2
by: Marco | last post by:
Hallo, I have made a microcontroller with keyboard (16 key). I have a function to handle interrupt that comes from keyboard when a key is pressed. I should make a C software (not graphic) with...
2
by: anil | last post by:
Hi Friends!! Does any body know the interrupt no. of the CD-Rom device to make it function like opening and reading etc..If any body knoow tell me ..I want to learn hardware programming through...
0
by: LordHog | last post by:
Hello all, I have a little application that will be used for test environment that utilizes the CAN Messaging. The application will capture and then decode the CAN message that are received. In...
2
by: bvermeersch | last post by:
Hi, Here I am again, just learning C# and always wanting to learn the hard things first. As you might already know from other posts I'm trying to convert c++ code to C#. The problem I'm...
27
by: tomhr | last post by:
I have a Borland Turbo C++ compiler (though I never use the "plus-plus" part), copyright 1990. I use this compiler to write simple programs, one of which I am quite dependent on. A month ago, my...
2
by: Hartmut | last post by:
Hi guys out there..., I am not shure if this is the right forum for my Question. Have a problem using my own Keyboard interrupt handler. The handler works fine as long as i do not press keys...
5
by: mysli | last post by:
Hi all, I need to write a ISR using Microsoft VC++ 2005. The proplem is I did not found any hint on how to do it. I can register any function as a ISR and it will be called by the hardware...
2
by: =?Utf-8?B?QnJ1Y2UgSFM=?= | last post by:
I'm using VS2005 Winforms. I want a method to allow the user to be able to interrupt an SQL query if he decides he doesn't want to wait for it any longer. I've used IAsyncResult to open an...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.