Need help with my smart car!

Hi I am fairly new to arduino and programming. I have been making a smart car but I have run into some trouble. My car is going to be controlled by a IR remote, and I was making it to when you pressed 0 for example, it would go into obstacle avoidance mode, I tried using the Goto statement but that did not work. I need Help!

I tried using the Goto statement but that did not work.

I'm not surprised. My crystal ball says that line 4545456544546444565 of the code you didn't post is wrong.

I think Arduino doesn't have goto.
If you're not familiar with the language please read the online guides.

GreenSmurf:
I think Arduino doesn't have goto.

I think know that statement is incorrect, it's just that, in polite company, we don't talk about it.

Michael30040:
when you pressed 0 for example, it would go into obstacle avoidance mode,

You need a variable to keep track of what mode you are in. You also need 'if' or 'switch' statements to execute the appropriate parts of loop() for the current mode. You probably want to check for IR input regardless of mode. If you only process input in 'remote control' mode you will never be able to switch out of 'object avoidance' mode.

Thank you!

AWOL:
I think know that statement is incorrect, it's just that, in polite company, we don't talk about it.

Oh there really is goto?
I've never seen anybody using it.
Sorry for posting wrong information

GreenSmurf:
Oh there really is goto?

Shhh. First rule of Arduino Club.

Can someone give me an example?

switch (mode):
  case IR_CONTROL:
    irMode();
  break;
  case AUTONOMOUS:
    autonomousMode();
  break;
}