Download MetaTrader 5

Getting enumaration expressions from Print()

To add comments, please log in or register
Share your knowledge. Become a well-known developer!
kemalturgay
265
kemalturgay 2015.01.10 16:26 

I would like to print enumaration expressions, not integers, to the expert log.

For example, for the following code, is there a more smart way of doing this?

   PositionSelect("GBPUSD");
   Print(EnumToString((ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE)));  
Alain Verleyen
Moderator
30739
Alain Verleyen 2015.01.10 17:08  
kemalturgay:

I would like to print enumaration expressions, not integers, to the expert log.

For example, for the following code, is there a more smart way of doing this?

It's how to do it. What is not smart enough ?
kemalturgay
265
kemalturgay 2015.01.11 00:14  

As a newbie in C++ and MQL, sometimes, I can not be sure that I'm writing the code as it should be :)

To add comments, please log in or register