Is it possible to include entire folders to the code?

 

If you have to include files, you need to use #include one file by one, but is it possible to use a single line code and automatically include all include files inside a folder?

thanks

 

No!

and you don't want to do that anyway

 
Mrluck07:

If you have to include files, you need to use #include one file by one, but is it possible to use a single line code and automatically include all include files inside a folder?

thanks

Yes, you can make a general defines.mqh and include all the files you use most. And then just include that file once.

 
Cornelis Duiker:

No!

and you don't want to do that anyway

Why its not a good idea? If i have my library with 100 files, i have the work to define each one, that not very productive, if i could just select the folder where all include files are, it would be better, i think
nicholi shen:

Yes, you can make a general defines.mqh and include all the files you use most. And then just include that file once.

Yes but if you have lots of include files, each general define, you still need to select one by one, and write .mqh at the end, so very time consuming, but thanks i think i'll do this way you tell me, one define file as a hub to others.
 

Because you should keep your world clean.  Don't include stuff you do not need.  It slows down compile time and makes your EA bigger then what it needs to be.

My car does not have a coffee machine built in.

 

First you put everything on the same page but it get's too large, so then you start to divide it over includes, but then they get too many....

 
Mrluck07:
If i have my library with 100 files, i have the work to define each one, that not very productive

Write a script (e.g. python) to generate the defines.mqh file @nicolishen mentioned.

 
Mrluck07:
Why its not a good idea? If i have my library with 100 files...

or you are a very bad programmer, or you're trying to build a mammoth of bizarre proportions. I understand this kind of approach with languages without OO support, but with MQL5, come on!

Please explain to us why 100 files in a libray...

Maybe we can help you to structure your code in a better way...


;)

Reason: