Exists a Function to Know Whether a Class ia used by an Indicator, Expert or a Script?

 

Hi,

Am I correct, that there is no function or system-variable that tells a class whether it is called by an indicator, expert or a script?

 
Carl Schreiber:

Hi,

Am I correct, that there is no function or system-variable that tells a class whether it is called by an indicator, expert or a script?

I guess the MQLInfoInteger with MQL_PROGRAM_TYPE is what you look for.
MQLInfoInteger - Checkup - MQL4 Reference
MQLInfoInteger - Checkup - MQL4 Reference
  • docs.mql4.com
MQLInfoInteger - Checkup - MQL4 Reference
 
Ovo Cz:
I guess the MQLInfoInteger with MQL_PROGRAM_TYPE is what you look for.

Thanks - didn't know that!

It's a bit confusing, some information you get by __FILE__, __FUNCTION__, .. some like WindowsExpertName() and some by the function: MQLInfoInteger().

Its obviously an indication for a developing system.. ;)

MQLInfoInteger - Checkup - MQL4 Reference
MQLInfoInteger - Checkup - MQL4 Reference
  • docs.mql4.com
MQLInfoInteger - Checkup - MQL4 Reference
 
Carl Schreiber:

Thanks - didn't know that!

It's a bit confusing, some information you get by __FILE__, __FUNCTION__, .. some like WindowsExpertName() and some by the function: MQLInfoInteger().

Its obviously an indication for a developing system.. ;)

Not really, __FILE__ __FUNCTION__ are carry overs from the C pre-processor. Anything else is MT stuff that should be accessed by Info functions at runtime
Reason: