Quote:
|
Originally Posted by quksilver
It's a library header file. Like a .h file in C. Can contain common variable definitions and function definitions so you don't have to include them in every single expert.
|
That's right!
Besides:
When you use the Preprocessor
#include like that in your code:
#include <stderror.mqh>
The MQL4 compiler will replace this line of code with the code found in the file "stderror.mqh".
If you open any “mqh” file you will find it contains two things:
1- Importing the library it will use
2- Definitions of the variables and functions of the imported library.
For example this is the code of stdlib.mqh
//+------------------------------------------------------------------+
//| stdlib.mqh |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#import "stdlib.ex4"
string ErrorDescription(int error_code);
int RGB(int red_value,int green_value,int blue_value);
bool CompareDoubles(double number1,double number2);
string DoubleToStrMorePrecision(double number,int precision);
string IntegerToHexString(int integer_number);
Here the code:
1- imports "stdlib.ex4"
2- Write the definitions of the variables and functions of the imported library.
When you include "stdlib.mqh" in your code you can use its 5 functions:
ErrorDescription, RGB, CompareDoubles, DoubleToStrMorePrecision and IntegerToHexString.
to know more please refer to my MQL4 Course
Regards,
Coder's Guru