Why is the 'return' operator not necessary in this user-defined function?

 

Function call:

Fun_New_Bar(); 

User defined function:

//--------------------------------------------------------------------
void Fun_New_Bar()                              // Funct. detecting ..
  {                                             // .. a new bar
   static datetime New_Time=0;                  // Time of the current bar
   New_Bar=false;                               // No new bar
   if(New_Time!=Time[0])                        // Compare time
     {
      New_Time=Time[0];                         // Now time is so
      New_Bar=true;                             // A new bar detected
     }
  }
//--------------------------------------------------------------------

How does control return to the call site if there is no return operator at the end of the user-defined function?

 
koranged:

Function call:

User defined function:

How does control return to the call site if there is no return operator at the end of the user-defined function?

New_Bar is declared in the global scope. So, it can be accessed by other functions. 
 
Laszlo Tormasi:
New_Bar is declared in the global scope. So, it can be accessed by other functions. 

Okay that makes sense. But how does the control actually return to the call site in order for the rest of the start() functions code to be executed?

&

Does a void user-defined function require a return statement?

 

No.

That is why it has a type Void it will even generate an error when you try to return something.

 
Marco vd Heijden:

No.

That is why it has a type Void it will even generate an error when you try to return something.

Gracias.