MQL4 Reference Object Functions ObjectDescription

MQL4 Help as One File:

ObjectDescription

Returns the object description.

string  ObjectDescription(
   string   object_name   // object name
   );

Parameters

object_name

[in]  Object name.

Returned value

Object description. For objects of OBJ_TEXT and OBJ_LABEL types, the text drawn by these objects will be returned. To get the detailed error information, one has to call the GetLastError() function.

Example:

  // writing the chart objects list to the file
  int    handle, total;
  string obj_name,fname;
  // file name
  fname="objlist_"+Symbol();
  handle=FileOpen(fname,FILE_CSV|FILE_WRITE);
  if(handle!=false)
    {
     total=ObjectsTotal();
     for(int i=-;i<total;i++)
       {
        obj_name=ObjectName(i);
        FileWrite(handle,"Object "+obj_name+" description= "+ObjectDescription(obj_name));
       }
     FileClose(handle);
    }

See also

ObjectSetText()