call function

const int Sensor1 = 2 ;
int i;
void setup ()
{
  pinMode(Sensor1,INPUT);
}
void loop ()
{Sensor_1:
 // statement...............
}

void delay_function ()
{
for(i=0;i<10000;i++)
  {
  if (digitalRead(Sensor1) == 0)
     {
       goto Sensor_1 ; 
     }
  }
}

can i use goto function to Transfers program flow between different functions such as goto from void delay_function() to void loop()

no. I am not a goto-hater, but goto will not branch across functions.

If you think you need that, you better reconsider your program logic.

Using Goto is considered very poor programming practice. It makes it very difficult to read a program and to understand the structure of the program

You just call your function like this:

Delay_function();

When it is finished doing what it should, program flow will be returnd to where you called it from.

Never use goto's in a C/C++ program forget they exist. And No you can't.

Mark

MikMo:
You just call your function like this:

Delay_function();

When it is finished doing what it should, program flow will be returnd to where you called it from.

i need when make specific action such as press switch exit from Delay_function() and back to the void loop (), what order can i used

Your loop() is alway running.

So if you call your function from within loop, program flow will always be returned to loop when you exit your function.

So you need to implement the logic to read the switch in your function and then exit the function when the switch is pressed.

The C method of doing what you want is using the setjmp and longjmp functions.

#include <setjmp.h>

jmp_buf unwind_stack;

void
inner_function (void)
{
    if (some_condition ()) {
        lonjmp (unwind_stack, 1);
    }
}

void
loop (void)
{
    if (setjmp (unwind_stack) == 0) {
       /* normal code, do whatever you need here.  */
       inner_function ();

    } else {
       /* code after longjmp is called.  */
       Serial.println ("whoops");
    }
}

The C++ method uses try/catch exceptions (http://www.cplusplus.com/doc/tutorial/exceptions/). I am unsure if exceptions are fully supported in the Arduino environment.

However, as others have said, you probably should restructure your code not to need exceptions. I tend to think you want to use state machines, where you have a bunch of variables that say what to do, and check those each time inside of loop. Perhaps reading and really understanding blink without a delay (the time to restart the function is a simple minded state machine) would be a start.

MostafaHamdy:
i need when make specific action such as press switch exit from Delay_function() and back to the void loop (), what order can i used

Perhaps you should read about what "break" and "return" do. You probably want to use "return".

These, together with "continue" are softer forms of goto that the goto-haters tolerate.