Download MetaTrader 5

Possible mql5 bug - string

To add comments, please log in or register
mqltools
25
mqltools  

I'm modifying PositionInfoSample.mq5, and I added comment display capability.

The following code DOESN'T work:

const string a = m_position.InfoString(POSITION_COMMENT);
m_label_info[14].Description(a); 

The displayed result is: "Comment: 1".

The following code, however, does work: 

m_label_info[14].Description(m_position.InfoString(POSITION_COMMENT));

The position's comment is displayed correctly (as string).

What's the reason for this? If this behavior is correct, then, how to display a comment using variable indirection?

I'm attaching the whole PositionInfoSample.mq5 with my (albeit very small) modifications. 

Rashid Umarov
Admin
12400
Rashid Umarov  
What do you mean? There is just our code without your modifications here, we have checked and it works properly. Please, provide mode detailed information.

mqltools
25
mqltools  

I'm sorry! I didn't notice that the new metatrader writes everything in user's local folder. I just uploaded code from /Scripts from Program Files Metatrader's folder.

I'm attaching the correct version. 

(it's in the InfoToChart function) 

To add comments, please log in or register