Expert, Script or Indicator?

 
Hi there,

When writing a MT4 library is there a means programtically of determing whether the code is being called from an Expert, Script or Indicator?

For example...

void some_function() {

if (IsScript() == TRUE) {
// Do some script stuff...
}
else
if (IsExpert() == TRUE) {
// Do some expert stuff...
}
else {
// Must be an indicator then so do some expert stuff...
}

}

Obviously there aren't any MQL functions called IsScript() or IsExpert() but I would like to know if it is possible to write code that essentially does the same as the example above.

Regards,

Laurence.
 
You can write library function with desired call parameter, for exmple:
double   getValue(int shift,..., string whoCall)
{
   ...
   if (whoCall=="expert")
      {
      ...
      }
   if (whoCall=="indicator")
      {
      ...
      }
}