Features of the mql5 language, subtleties and tricks - page 114

 
pavlick_:

Two macros don't seem to hurt much.

It always hurts when there is no universal solution. Only the void stands out like that.

That's why instead of void it's better to make bool ... return(true) or something similar but not a ugly code type. Why they have created such a freak (no flexibility at all) is unclear.
 

Guys, please what else needs to be added here:

fH = FileOpen(fName,FILE_WRITE|FILE_CSV,';',CP_UTF8);

to create a normal csv file with UTF-8 encoding,

What am I doing wrong?

 
xxz :

Guys, please what else needs to be added here:

to create a normal csv file with UTF-8 encoding,

What am I doing wrong?

What's the problem?
 
Alain Verleyen:
What's the problem ?

when opening in excel I have to go through the delimiter recognition procedure all the time...
even if it's UTF-8 the file is still created in UTF-16...

and I don't know how to overcome it...

there's no such problem in 4...

 
xxz:

and how to beat it I don't know...

add FILE_ANSI?

 
TheXpert:

add FILE_ANSI?

add or replace?

 
TheXpert:

add FILE_ANSI?

added,

but it's all a bit of a mess...

 
Vladimir Pastushak:

I want to call the parent method

Here's the code, what am I doing wrong ???

//+------------------------------------------------------------------+
class A
  {
public:
   virtual int Test_A()
     {
      return 100;
     }
  };
//+------------------------------------------------------------------+
class B :public A
  {
public:
   virtual int Test_A()
     {
      return 200;
     }
  };

B b;
//+------------------------------------------------------------------+
void OnStart()
  {
   Comment (A::b.Test_A());
  }
//+------------------------------------------------------------------+


Inside B is like this

A::Test_A()

you can call the parent method.

And if you need it outside, then only through pointer casting. This is what virtual functions are made for, to be substituted depending on class type.

 
Andrey Barinov:

And if you need to go outside, only through pointer casting

Pointer casting won't do anything, no matter how you cast it, the object is the same.
 
fxsaber:

It always hurts when there is no one-size-fits-all solution. Only void stands out like that.

I won't write what is possible, otherwise it may turn out to be simple again and pavlick_ will ...lick_ again

Reason: