Is it possible to include entire folders to the code?

To add comments, please log in or register
Mrluck07
426
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

Cornelis Duiker
1501
Cornelis Duiker  

No!

and you don't want to do that anyway

nicholi shen
1870
nicholi shen  
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.

Mrluck07
426
Mrluck07  
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.
Cornelis Duiker
1501
Cornelis Duiker  

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.

Marco vd Heijden
Moderator
8157
Marco vd Heijden  

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....

Anthony Garot
1822
Anthony Garot  
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.

Minions Labs
1123
Minions Labs  
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...


;)

To add comments, please log in or register