Download MetaTrader 5

Getting enumaration expressions from Print()

To add comments, please log in or register
kemalturgay
265
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?

   PositionSelect("GBPUSD");
   Print(EnumToString((ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE)));  
Alain Verleyen
Moderator
31439
Alain Verleyen  
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  

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