Page 1 of 1

How to exit an NXC void

Posted: 01 Nov 2010, 05:03
by mattallen37
How do you exit/stop/end a void in an NXC program?

Re: How to exit an NXC void

Posted: 01 Nov 2010, 06:08
by mightor
try "return" with no value.

- Xander

Re: How to exit an NXC void

Posted: 01 Nov 2010, 14:21
by afanofosc
Maybe you are talking about an NXC function or subroutine or procedure that has no return value? For the sake of clarity I encourage you to refer to a function that returns no value as either a "function" or a "procedure" or a "subroutine" rather than a "void". The keyword void is just the type returned by a function that returns no value.

I recommend this wikipedia page: http://en.wikipedia.org/wiki/Void_type. It says:
A function with void result type ends either by reaching the end of the function or by executing a return statement with no returned value.
That's the standard C mechanism for exiting a function early (as Xander already mentioned). Happy B-day, Xander!!!

John Hansen