Errors, bugs, questions - page 2969

 
Can anyone share a handy windows/chart manager? Need alphabetical sorting of the list, contextual search, hierarchical display of all downloaded EAs, scripts, indicators; fast switching.
 
Stanislav Korotky:
Is there any way to know that MQL-program was started as a result of terminal start (i.e. automatically at the beginning of session) and not interactively by user?

You can write to the reason file at OnDeinit and load it at startup. If the loadedreason wasREASON_CLOSE, then the program was loaded as a result of terminal start(because it was terminated as a result of closing it). If it's not there or different, then different...

Документация по MQL5: Обработка событий / OnDeinit
Документация по MQL5: Обработка событий / OnDeinit
  • www.mql5.com
OnDeinit - Обработка событий - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Stanislav Korotky:

Try the patched version of the ControlsPlus windows and controls library from this article. There, the rubberization was supported automatically.

Thanks, but that's not it, at all. Need to tweak code that works on SB

 

Editor's bug with extra space

https://photos.app.goo.gl/CK2KSZaKVRKMCz1S8

here's how the bug disappears

https://photos.app.goo.gl/bSPtMDL4MKSKpbFP6

copy of uncompilable, as in the example


same problem in mt5

Files:
err.mq4  2 kb
err.mq5  2 kb
 
Vitaly Muzichenko:

Thanks, but that's not it, at all. We need to tweak the code that works on the SB.

What do you mean it's not the same at all? I offered to take the patched SB version, which solved the above problem. Well, you're the boss.

 
Stanislav Korotky:
Can anyone share a handy windows/chart manager? Need alphabetical sorting of list, contextual search, hierarchical display of all loaded EAs, scripts, indicators; fast switching.

Perhaps F2 in the Terminal of a fresh build will partly help.

 
Stanislav Korotky:

What do you mean it's not the same at all? I suggested taking the patched version of the SB, which solved the problem. Well, the boss is the boss.

You have to carry it everywhere, and the SB is always there. That's the key "wrong".

What you need is a variant of the edit with an SB.

 
Andrey Sokolov:

Editor bug with extra space

***

here's how that bug disappears.

***

copy of uncompilable, as in the example


same problem in mt5

Pictures are inserted using the Image button or attached using the Attach file ru button .

 

Despite what the documentation says, GlobalVariableCheck () does not change the access time.

Возвращаемое значение

Returns the time of the last access to the specified global variable. Accessing the variable for a value, e.g. using GlobalVariableGet() and GlobalVariableCheck(), also changes the last access time. To get the error information, call GetLastError().

Fix either the documentation or the behaviour of the function.

Документация по MQL5: Глобальные переменные терминала / GlobalVariableGet
Документация по MQL5: Глобальные переменные терминала / GlobalVariableGet
  • www.mql5.com
GlobalVariableGet - Глобальные переменные терминала - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

Error with derived structure, where no new data is added when saving / loading from file.

struct Base
  {
   int               anInt;
   double            aDouble;
                     Base(void)
     {
      anInt   = WRONG_VALUE;
      aDouble = WRONG_VALUE;
     }
  };
struct DerivedNoNew : public Base
  {
   void              Set(int iValue,double dValue)
     {
      anInt   = iValue;
      aDouble = dValue;
     }
  };

const string filename = "TestStructToFile";
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   Base base[1];
   DerivedNoNew derived[1];
   int sizeof1   = sizeof(Base);
   int sizeof3   = sizeof(DerivedNoNew);

   int handle=FileOpen(filename,FILE_BIN|FILE_WRITE);
   if(handle!=INVALID_HANDLE)
     {
      derived[0].Set(5,12.0);

      uint written1 = FileWriteStruct(handle,base[0],sizeof1);
      uint written3 = FileWriteStruct(handle,derived[0],sizeof3);   // NOT saved
      int err       = _LastError;
      FileClose(handle);
     }

   handle=FileOpen(filename,FILE_BIN|FILE_READ);
   if(handle!=INVALID_HANDLE)
     {
      uint read3  = FileReadStruct(handle,derived[0],sizeof3);      // NOT loaded
      uint read1  = FileReadStruct(handle,base[0],sizeof1);
      FileClose(handle);
     }
  }
2021.02.22 12:52:11.188 FileAndStructIssue (EURUSD,D1) Written 1: 12 2: 20 3: 0 (error 4003) Total: 32 FileSize: 32
2021.02.22 12:52:11.193 FileAndStructIssue (EURUSD,D1) Read 1: 12 2: 20 3: 0 (error 4003) Total: 32

Files: