Errors, bugs, questions - page 2361

 
Artyom Trishkin:

Maybe it should be displayed in the features?

I'll try to design it.

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

Dear web designers of the website,

Here is a screenshot of the messages, please tell me which interlocutor is currently selected


Already my eyes are climbing on my forehead to understand who I'm writing to .....

Please colour code those to whom you haven't responded, those to whom you have responded, and a separate colour code for the person you are texting to ...

 
Vladimir Pastushak:

Dear web designers of the website,

Here is a screenshot of the messages, please tell me which interlocutor is currently selected


Already my eyes are climbing on my forehead to understand who I'm writing to .....

Please colour code those to whom I have not responded, those to whom I have responded, and a separate colour code for the person I am texting...

2

I agree though. You do not always notice it, there is little contrast.

 
Vladimir Pastushak:

Here is a screenshot of the messages, please tell me which interlocutor is currently selected

in Chrome(71.0.3578.98) ok in FF (64) not visible at all
 
In general, it would be good to add contrast throughout the site
 

if it's possible to dereference a *CObject pointer in MQL ?

I tried different variants, here is a script for test, I add 3 Myclass elements to linked list and then change values of CMyclass fields, it works:

#include <Object.mqh>
#include <Arrays\List.mqh>
//+------------------------------------------------------------------+
class CMyclass:public CObject
  {
public:
   int               x;
   double            y;
   void              CMyclass(void):x(-1),y(-2.2) { }
  };
//+------------------------------------------------------------------+
void OnStart()
  {
   CList *base=new CList;
   CMyclass *result;
   for(int i=0;i<3;i++)
     {
      base.Add(new CMyclass);
      result=base.GetCurrentNode();
      result.x = 99;
      result.y = -555.5;
     }
   for(int i=0;i<3;i++)
     {
      result=base.GetNodeAtIndex(i);
      Print(result.x," : ",result.y);
     }
   delete base;
  }
//+------------------------------------------------------------------+

Can I modify fields of dynamically created CMyclass elements, without intermediate pointerCMyclass *result ?

Like this:(CMyclass *)(base.GetCurrentNode()).x = 99;

PS: I suspect we need to use typedef , but so far unsuccessful

 
Igor Makanu:

if it's possible to dereference a *CObject pointer in MQL ?

I tried different variants, here is a script for test, I add 3 Myclass elements to linked list and then change values of CMyclass fields, it works:

Can I modify fields of dynamically created CMyclass elements, without intermediate pointerCMyclass *result ?

Like this:(CMyclass *)(base.GetCurrentNode()).x = 99;

PS: I suspect we need to use typedef , but so far unsuccessful

I don't know what the library CList does, but I used to do this

#define  alive(node)  (CheckPointer(node)==POINTER_DYNAMIC)
#define  loopf(type, node)  for(type *o=alive(node)?node.First():NULL; alive(o); o=alive(o)?(alive(o.Next())?o.Next():NULL):NULL)
//.....
      loopf(COrder, corr){
         if((fabs(o.StopLoss()-sl)>=_point(o.Symbol())) || (fabs(o.TakeProfit()-tp)>=_point(o.Symbol()))){
            o.SLTP(sl, tp);
         }
      }
//.....
 
Ilya Malev:

I don't know what the library CList does, but I used to do this

Thanks, it's not what i'm looking for, your example is in fact a type conversion via function call

SZZ: I'm not used to working with pointers in MQL, I'm trying to understand it. This example seems to be simple and working, but I haven't found any solution, how to bring the result ofGetCurrentNode () -->CObject * to myCMyclass....typeOf course, I can use theCMyclassconstructor, but I hope, it's possible to work out a neat solution in MQL

 
Igor Makanu:

Thanks, it's not what I'm looking for, your example is in fact a type conversion via function call

SZZ: I'm not used to working with pointers in MQL, I'm trying to understand this simple and working example, but I haven't found any solution to bring the resultGetCurrentNode () -->CObject * to my typeCMyclass.... Of course, I can useCMyclassconstructor, but I hope, there is a smart solution of type conversion in MQL

I don't have functions there, my problem is the one you've described. My base class is CNode ( which has methods Prev(), Next() etc.) The loop calls fields of COrder, which is its descendant. The loop is declared in defines 1 time and then is used everywhere.

Reason: