Print Call Stack function

 

Hi there,

I have been looking in the forum for a way to print the call stack to know which function called another function but I have not read anything related to that. I have a function called "processError" which takes care of error handling and it would be nice to be able to print where the error was generated by "somehow" printing a call stack like other languages do (Java,PHP) when you get an exception. Has anyone figured out a workaround to do anything like this in mql4? Apart from the option of using an argument for the name of the function that is calling? Let's say we want to go deep down to 'start()'.

Looking for ideas! Thanks

 
sokramm:

Apart from the option of using an argument for the name of the function that is calling? Let's say we want to go deep down to 'start()'.

We don't even have a debugger so I doubt there is anything like what you are describing.  Why don't you just have a debug option that you can turn on and off from the parameters then add a line like . . . 

if(Debug) Print("Calling processError from start . . . ");

 before the line that calls the function ?

Reason: