How to get #property version from EA? - page 2

 
Fernando Carreiro #:

Just as explained in post #1, use macro substitution instead. This is my rendition ...


Regarding to:

#define     MBuild         "2022-06-15 13:30 WEST"

May I know there is a way to define the MBuild dynamically during build time?
Instead of hardcode it every time.

 
Too Chee Ng #:

Regarding to:

May I know there is a way to define the MBuild dynamically during build time?
Instead of hardcode it every time.

https://www.mql5.com/en/docs/constants/namedconstants/compilemacros

#property script_show_inputs
#define MBuild (string)__DATETIME__
#property version MBuild

void OnStart() {}

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
To simplify the debugging process and obtain information about operation of a mql5-program, there are special macro constant, values of which are...
 
Vladislav Boyko #:

I forgot that in that post the build information was placed in the description, not in the version. But that doesn't matter in the context of your question.

#property script_show_inputs
#define MBuild        ((string)__DATETIME__ + " WEST")
#property version     "1.23"
#property description "MetaTrader Expert Advisor (Build "MBuild")"
#property copyright   "Copyright \x00A9 3025, John Doe, No rights reserved"

void OnStart() {}


 
Vladislav Boyko #:

I forgot that in that post the build information was placed in the description, not in the version. But that doesn't matter in the context of your question.


Thank you!!!