Errors, bugs, questions - page 716

 
MetaDriver:

Global variables don't have to be initialized automatically either. You're probably just "lucky". Lucky in quotes, because such luck is fraught with subsequent craze with left-wing claims to developers, such as "yesterday it worked and today it doesn't. Your platform is unstable...!".

From the help. The scope of global variables is the whole program, global variables are accessible from all functions defined in the program. They are initialised with zero, unless another initial value is explicitly specified.

Such errors occur after you try to handle global variables.

P.S. You must be peckish from silly questions of beginners, you write off furiously about it. The compiler, I think, doesn't care how much code, extra initialization only slows it down for a fraction of a second, and the tester of strategies is another matter.

Документация по MQL5: Основы языка / Переменные / Глобальные переменные
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
  • www.mql5.com
Основы языка / Переменные / Глобальные переменные - Документация по MQL5
 
sion:

From the help. The scope of global variables is the whole program, global variables are accessible from all functions defined in the program. They are initialised with zero, unless another initial value is explicitly specified.

There is also a link below See also on Variable initialization.

Any variable can be initialized when defined. If the variable is not explicitly initialized, the value stored in this variable can be anything. Implicit initialization is not performed.

 

Initialised with zero, unless another initial value is explicitly specified.

Implicit initialisation is not performed.

I don't know what to believe. Either they are initialized with zero if no value is explicitly specified or implicit initialization is not performed. Or something else in general)

 
sion:

I don't even know what to believe. Either it's initialised with zero if no value is explicitly set, or it's not initialised implicitly. Or something else in general.)

You can't trust anybody. You can trust me.

Why turn the question of programming culture into a question of faith? You don't do explicit initialization? Glitches will come to you sooner or later (and not necessarily in mt5)

 
stringo:

You can't trust anyone. I can (c) Müller

Why turn the question of programming culture into a question of faith? You don't do explicit initialisation? Glitches will come to you sooner or later (and not necessarily in mt5)

Let's rely on intuition. My last posts seem to be all right to wipe off, water is nothing to talk about.
 
sion:
Let's rely on intuition. You can probably wipe my last posts, water is nothing to talk about.

Why rely on intuition in such a delicate matter?

Just initialize all your variables explicitly. The question of unnecessary initialization in some cases is relevant only for professionals that squeeze clock cycles to save microseconds.

 

build 630

TheArrayResize()function(ArraySetAsSeries()=true)deletes a wrong item when the array size is reduced.

It deletes the item with index 0, while it should be the lastitem of the array, i.e. with index (n-1) where n is the array's size.

Everything worked fine in autumn 2011 builds.

 
MoneyJinn:

ArrayResize() error when decreasing array size when ArraySetAsSeries() = true.

Deletes element from wrong side of array.

Are you saying that the "oldest element of the array" (the leftmost one) is removed?
 

curwords=GetPointer(firstwords);
Print("next======",curwords.m_next!=NULL);
while(curwords.m_next!=NULL || curwords.length<pp){ curwords=GetPointer(curwords.m_next); }

when testing an EA for a highlighted word, the error indicatesinvalid pointer access in 'iTester 7.mq5' (161,16) and then stops

what's the trick here?

if you write: while( firstwords.m_next!=NULL || curwords.length<pp){ curwords=GetPointer(curwords.m_next); } error moves invalid pointer access in 'iTester 7.mq5' (161,43 )

 

fellow:

what's the catch?


curwords = NULL