mqh multiple file inclusions?

 

If myIndicator.mq4 includes:

#include "commonInclude.mqh"

#include "include1.mqh" 

#include "include2.mqh" 

and

both include1.mqh and include2.mqh include:

#include "commonInclude.mqh"

// custom code

how many times will commonInclude.mqh be included in the compiled version?

 
nikolaygmt:

If myIndicator.mq4 includes:

#include "commonInclude.mqh"

#include "include1.mqh" 

#include "include2.mqh" 

and

both include1.mqh and include2.mqh include:

#include "commonInclude.mqh"

// custom code

how many times will commonInclude.mqh be included in the compiled version?

You may include it as many times as you need it, but only the first appearance is used by the compiler.
 
Thank you Ovo!
 
//+------------------------------------------------------------------+
//|  9:47 AM 8/8/2015                               basic_types.mqh |
//|                              Copyright © 2015, William H. Roeder |
//+------------------------------------------------------------------+
#ifndef BASIC_TYPES_MQH
#define BASIC_TYPES_MQH
//+------------------------------------------------------------------+
   :
#endif   // BASIC_TYPES_MQH
//+------------------------------------------------------------------+
Or put include guards like C++ and don't assume
Reason: