Errors, bugs, questions - page 2831

 
A100:

You're off-topic again - there's no difference. In both cases: either there should be no error - or there should be (as in C++). Here is example (3), where f is overridden after, as in case (2), but unlike (2) - compile-time error

sorry, not your level. but more strict and not sensible encapsulation in my opinion. not c or python.

 
Let's combine everything in one example:
class B {
public:
        B( int ) {}
};
class A {
        int f( int ) { return 0; }
        void g1()    { B f = f( 1 );  } //(1) нормально
        void g2()    { B f(  f( 1 )); } //(2) Error: '1' - some operator expected
};
Now ALL is the same, and the question is the same: What is the difference between (1) and (2)?
 
A100:
Let's combine everything in one example: Now ALL is the same, and the question is the same: What is the difference between (1) and (2)?

I have no idea what you're talking about at all, but the difference is AMAZING )))) Assignment -> argument. Maybe I'm wrong ))))

 
Сергей Таболин:

I have no idea what you're talking about at all, but the difference is AMAZING )))) Assignment -> argument. Maybe I'm wrong ))))

If the difference is obvious to you, then explain why there is a compilation error in one case and not in the other. Or can you tell the difference only by appearance and not by meaning!? Then this is the level of Murzilka magazine - "find 10 differences".

 
A100:

If the difference is obvious to you, then explain why there is a compilation error in one case and not in the other. Or can you tell the difference only by appearance, but not by meaning? Then this is the level of the magazine Murzilka - "find 10 differences"?

That's right )))))))

And may I ask one more question from a layman? What's the point of all this? What's the sacramental point? Are you looking for these "bugs" on purpose? Or without one of these constructs, your whole life is a waste?

 
Сергей Таболин:

And can I ask one more question from a layman? What is the point of all this? What is the sacramental point? Do you look for such "bugs" on purpose? Or without any of these constructions - all life is a waste?

For such questions (in this thread) it's time to ban

 

As long as it's about errors. Is there any solution to DLL and manual stopping of tester?

I mean, if you stop tester/optimization in process, then to start over, you have to kill metatester64 manually (and in case of farm - there's additional hell), because process leaves DLL loaded, and to start new test it copies DLL into sandbox again, but apparently, Windows doesn't allow to overwrite opened DLL and write error.

And if developers run through here, why not add 4 lines to the tester code, so it would try to get the library handle, and if it's loaded - unload it before copying again? It's a mess ;)

 

how to write the current local time to one of the table fields from the strategy tester in SQLite?

Googled

SELECT datetime('now');

i would like to send in one query to the database

i want to write the optimization passes in the database, i really miss the local time - i forget when i examined which EA parameters

UPD:

Found a solution, enough datetime() in the test field to write

INSERT INTO "tst"("Field1") VALUES (datetime('now','localtime'));
 
Igor Makanu:

how to write the current local time to one of the table fields from the strategy tester in SQLite?

Googled

i would like to send in one query to the database

i want to write the optimization passes in the database, i really miss the local time - i forget when i examined which EA parameters

UPD:

Found solution, enough datetime() in the test field to write

CREATE TABLE "foo" (

   "stamp" datetime default CURRENT_TIMESTAMP,

    --- прочие поля

);

should work - stamp will be set at record creation to current local time.

 
A100:
Let's combine everything in one example: Now ALL is the same and the question is the same: What is the difference between (1) and (2)?

Well it's obvious that the problem is most likely the same name as the function - it's an appearance evaluation, so to speak, anticipating the peculiarities of the language))) Well it should work like this..... imagine finding such an error in a ton of code.

I checked it - yes, everything is correct. The compiler is trying to call the constructor inside the constructor and not the function for the second time.

In the second case, it turns out that the compiler for some reason reserves the syntax "f(" - precisely as a "function" to call the constructor.

class B {
public:
        B( int ) {}
};
class A {
        int f( int ) { return 0; }
        void g1()    { B f = f( 1 );  } //(1) нормально
        void g2()    { B f(  this.f( 1 )); } //(2) Прекрасно работает
};


Although it is not exactly so))) but...

It is even more likely that while waiting for the class's parenthesis to return to the "f(" syntax... it encounters it at the function f(....) and closes it as a class (i.e. in our case it completely initializes object B instead of calling the function)... then it solves the remaining segment trying to convert the class into a variable

it looks like your code tries to figure out how


class B {
public:
        B( int ) {}
};
class A {
        int f( int ) { return 0; }
        void g1()    { B f = f( 1 );  } //(1) нормально
        void g2()    { B a(1);  B f (a(1)); } //(2) Error: '1' - some operator expected
};
Быстрое погружение в MQL5
Быстрое погружение в MQL5
  • www.mql5.com
Есть множество причин, по которым вы решили изучать современный язык программирования торговых стратегий MQL5, и мы только приветствуем это! Старожилы легко ориентируются как в самой документации по языку, так и в статьях и множестве сервисов, которые здесь представлены. Но если вы только открыли для себя клиентский терминал MetaTrader 5, то в...
Reason: