Errors, bugs, questions - page 470

 

Renat, somehow there was talk of separating the symbol and period change as a reason for deinitialisation/initialisation.

Is it worth waiting for, or does everyone understand what is needed, but don't really want to do it?


 
There is no solution yet.
 
Renat:
There is no solution yet.
Let's go into a little more detail here. What's the difficulty?
 
  int Smbl[0];

error

'0' - invalid index value       usChrt001m.mq5  13      10
how is that even possible?
 
A static array of zero size cannot be defined.
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
  • www.mql5.com
Основы языка / Типы данных / Объект динамического массива - Документация по MQL5
 

Got it, thank you.

 
class FileUnlimited
{
public:
   enum MovePointerMethod
   {
          MPM_BEGIN = FU_FILE_BEGIN            // relative count from the beginning
        , MPM_CURRENT = FU_FILE_CURRENT        // relative count from current
        , MPM_END = FU_FILE_END                // relative count from the end
   };
};

class ConstFile
{
   //...
   virtual bool SetPos(long pos, MovePointerMethod from = MPM_BEGIN){return false;}
};
Why does it compile? Even if you put a privat.
 
Silent:

Yeah, I'm trying to cram the values in...

if it's like this...

it swears, declaration without type, declaring types

It's totally nuts.

What's the right way - stat. array and fill it with values? the help with examples is a disaster.

As far as I understand you're trying to declare and initialize the array element by element at global level - this is forbidden. At the local level it compiles without errors.

Or try to initialize the array elements with an initialization sequence - https://www.mql5.com/ru/docs/basis/variables/initialization:

int Smbl[8]={1,2,3,4,5,6};
Документация по MQL5: Основы языка / Переменные / Инициализация переменных
Документация по MQL5: Основы языка / Переменные / Инициализация переменных
  • www.mql5.com
Основы языка / Переменные / Инициализация переменных - Документация по MQL5
 
Rosh:

As far as I understand, you're trying to declare and initialize an array element by element on a global level - this is forbidden...

Exactly so :)

So, you can't use the array as an input right away?

 
Silent:

So you can't use an array as an input straight away?

Yes

'Smbl' - objects and arrays are not allowed as inputs   usChrt001m.mq5  14      11

Too bad.

Upgr all the same, why is it done that way? Why can't I make a static input array right away and have to duplicate variables?