Thread: is there an if/else function that implements IMMEDIATELY?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    28

    is there an if/else function that implements IMMEDIATELY?

    I'm in the middle of righting a program for a servo motor. I'd like to use an if and else to have the motor exit the main program with a pin going low and I'd like it to do it immediately.

    Right now I have it as an

    Code:
    if ...
    {
    whole bunch of for loops.....
    ...
    ...
    ...
    }
    
    else...
    {
    single command.
    }

    and it's working but the problem is that it doesn't exit out of the if statement's code immediately and that's what I'm after. Right now it's running the code in the if statement from start to finish. I'd rather have it jump to the else immediately and NOT finish the if's code.


    Is there a good way to pull that off?
    Last edited by 777funk; 11-23-2010 at 03:46 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM