ObjectSet and ObjectSetText not recognised by MetaEditor context sensitivity and don't operate as expected

 

Hello

Trying out code from https://www.mql5.com/en/forum/130611/3340415#comment_3340415 as I have plotted a series of HLINEs and want to change the font of the descriptions of each:

  

if(ObjectSetText(_lineName, "What you want to call your line", 8, "Arial", Magenta)) {
    afxHandleError(GetLastError(), __FUNCTION__+": ERROR ObjectSetText returned false with these (_lineName,_desc,_fontSize,font,_lineColor) of: |"+_lineName+"|"+_desc+"|"+_fontSize+"|"+font+"|"+_lineColor+"|");
} else {
    Print(__FUNCTION__+": [OK] ObjectSetText returned OK with these (_lineName,_desc,_fontSize,font,_lineColor) of: |"+_lineName+"|"+_desc+"|"+_fontSize+"|"+font+"|"+_lineColor+"|");
}

Does not work.  Nor does it if I change Magenta to clrMagenta.  The ObjectSetText reference was not highlighted in metaeditor when I tried checking internal list of functions nor did it offer me args when I hit the '(': not in the compiler version 1601 build?

GetLastError Error code comes back as 0 no error.  Weirdly, the text is updated, but stays grey, sized and font like the system color of the top-left of every chart.

Is this a bug, or something wrong with my system?

Thanks

Adding Text to a Horizontal Line
Adding Text to a Horizontal Line
  • 2010.12.14
  • www.mql5.com
This seems like quite an easy thing that I am trying to do but I have created an indicator that draws a horizontal line and sends an alert when pri...
 
You posted code says if the call succeeds (returns true) print an error message, otherwise print OK. That is why the error code comes back as zero.