Errors, bugs, questions - page 1687

 
Question. The size of an empty class in MQL is 16 bytes (in a 64-bit system). Why? 8 bytes must be occupied by the pointer to the virtual table (according to the documentation, all classes have it in MQL). And the remaining 8 bytes are occupied by what?
 
Colleagues, has anyone encountered this problem? The terminal was updated to biuld 1430 this morning. And as coincidence, yesterday I have rewritten my Expert Advisor for working with files via standard library (before it was not entirely successful using standard file operations), but have not tested it - I have postponed it for morning. And here is the result: the Expert Advisor does not find a file during testing - the FileIsExist function always returns false. I do not know where the flaw is - whether it is in my modifications or the update. The thing is, the documentation says that the file must be located in the MQL5/Tester/Files folder during testing. However, in reality, the pathway is different: ...{Roaming\MetaQuotes\Tester\...some hex crap...\Agent-127.0.0.1-3000\MQL5\Files. I.e. at least there's an error in the documentation. But the main thing is that when testing starts, the file placed there manually is erased from the specified folder, although my FileIsExist function is prescribed in OnInit and it is the first to access the files. So I have a question: where should a file be located during testing? And what happens at all?
 
BlackTomcat:
Colleagues, has anyone encountered this problem? The terminal was updated to biuld 1430 this morning. And as coincidence, yesterday I have rewritten my Expert Advisor for working with files via standard library (before it was not entirely successful using standard file operations), but have not tested it - I have postponed it for morning. And here is the result: the Expert Advisor does not find a file during testing - the FileIsExist function always returns false. I do not know where the fault lies - either in my modifications or because of the update. The thing is, the documentation says that the file must be located in the MQL5/Tester/Files folder during testing. However, in reality, the pathway is different: ...{Roaming\MetaQuotes\Tester\...some hex crap...\Agent-127.0.0.1-3000\MQL5\Files. I.e. at least there is an error in the documentation. But the main thing is that when testing starts, the file placed there manually is erased from the specified folder, although my FileIsExist function is prescribed in OnInit and it is the first to access the files. So I have a question: where should a file be located during testing? And what happens at all?
Well, the problem was worked around by using the FILE_COMMON flag.
The file will be located in the folder ...{Roaming\MetaQuotes\Terminal\Common\Files. During testing it is not deleted from there and can be read normally.
 

Question: How do I find my posts in MQL4 forum? About two years ago a thread was created with attached code and this code has now become interesting, but forum search is silent. If I go to my publications, this topic is not there. (deleted?)

 

How do I know if a macro has ever been used or not?

 
fxsaber:

How do I know if a macro has ever been used or not?

like this:

#ifndef __MY_MACROS__   // если макрос не использован
   #define __MY_MACROS__
//----------------------------------------
// тут ваш код использующий макрос
//----------------------------------------
#endif // __MY_MACROS__
 
coderex:

like this:

I meant the other thing.
#define  MACROS(A) A

void Func()
{
  MACROS(A) // Если закомментировать, то макрос ни разу не использовался
}

// Вот здесь хотелось бы понять, использовался ли хоть раз макрос или нет.
 
Help me figure out how to make a check in the source if OnInit is defined or not?
 
fxsaber:
I was referring to something else.
The simplest is a macro call counter in a global variable, overwritten from the macro itself.
 
Sergei Vladimirov:
The simplest is a macro call counter in a global variable, rewritten from the macro itself.
There is such a variant, but it is not suitable for all macros, unfortunately.