Possible mql5 bug - string

 

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. 

 
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.
 

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

Reason: