Errors, bugs, questions - page 2642

 
Alexey Viktorov:

Probably because only a person at first glance looks at such code

The programmer can figure out what is going to happen without thinking about it. In my opinion, the complaint should be to C and C++, not to MQL. It's mql that protects against such occasional bugs.

There is no such error in C/C++.

Sergei Tabolin:

This function of yours is a bug. If i==100, the next check for the same i==100 will not work. And we will get an infinity loop.

Take a closer look. There is no error in the function I posted above.

 
traveller00:

There is no such error in C/C++.

Take a closer look. There is no error in the function I posted.

Why are you arguing? You've been given the answer. Use

Forum on trading, automated trading systems and strategy testing

Errors, Bugs, Questions

Vladimir Karputov, 2020.02.11 05:11

If the function is not declared as void, it must return a value:

bool Func()
{
  for(int i=1;;++i)
  {
    if(i==1)
      continue;
    if(i==100)
      return false;
  }
  //---
  return(false);
}

 

We need to remove the wallet and balance numbers from the header of the partytal - they are totally unnecessary and little used information!

My forum is now only accessible via the drop-down box - horror!

 
How is it possible to automatically collect all the files that mq5 uses? I need to transfer an Expert Advisor source code. There are dozens of files inluded from different folders.
 
fxsaber:
With what is possible to automatically collect all the files that uses mq5? I need to transfer the source code of an EA. There are dozens of files inluded from different folders.

with a third party compiler

I usedGCC to compile codes and open defines, but you can not run it in 2 clicks, it seems it can only compile all the inludes in a local folder and it seems the main file must have a .c extension

Try to run it at least on the command line.

 g++ -E tst.c -o tst.ii

tst.c is the main file and tst.ii is the output text file.

 
Igor Makanu:

by a third-party compiler.

So it can't know what

#include <..\Experts\FileName.mqh>

should be taken relative to the Include folder.

 
fxsaber:

So he can't know what

should be taken relative to the Include folder.

yes, most likely it can not, it needs full paths in the precompiler directive - but as I wrote, I still have to copy the project to a local folder, and there to arrange everything into folders, it seems long file paths it also can not C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\E6E3D0917AE641512E4779524EB3B1AA

But GCB can definitely build MQL programs - I checked it about six months ago, try it or wait to see if anyone can tell me.

 
fxsaber:
How is it possible to automatically collect all the files that mq5 uses? I need to transfer the source code of my EA. There are dozens of files inluded from different folders.

Sysinternals ProcMon.

 
fxsaber:
What is the automated assembly of all files that uses mq5? I have to transfer the source code of my Expert Advisor. There are dozens of files inluded from different folders.

Thisarticle in particular was written for this task. There is only a list of dependencies, of course. To pack it all together, you'll need some tweaking.

Синтаксический анализ MQL средствами MQL
Синтаксический анализ MQL средствами MQL
  • www.mql5.com
Суть программирования заключается в формализации и автоматизации неких процессов с помощью языков общего или специального назначения. Торговая платформа MetaTrader позволяет применять программирование для решения самых разных задач трейдера, благодаря встроенному языку MQL. И обычно процесс программирования строится на анализе и обработке...
 

If you describe such a structure:

struct MyStruct
   {
   double d_value;
   int    i_value;
   uchar  arr_u[100];
   };

and write it to a file, can there be differences when writing to MQL5 and reading to MQL4 of this file? or vice versa...

or vice versa... In general, is there any difference in languages for storing complex data types? (in memory, in files)

Reason: