ArrayResize doesn't work! - page 2

 
Issam Kadhi #: in the code, you can see that the array is defined there, i didn't use it in other parts in the code. the array is new, but it is giving the error. nothing to do with the other parts of the code. i even modified the name of the array but same error. i am even not using any library or include. i wish that mt4 didn't become fake like mt5, i think you know the stupid mt5 compilator and even platform, but if same developers doing both, this is the reason. i hope i'm wrong.

Can you try making a completely new file with just that code and testing it? Maybe there is some hidden unicode characters which are causing a problem.

I used the following isolated code (for a Script) and I was unable to replicate your issue. Can you try it on your end please?

void OnStart()
{
   double tab[];
   ResetLastError();
   int nResult = ArrayResize( tab, 30 );
   if( nResult <= 0 )
      PrintFormat( "Error %d, Result %d — Unable to resize array", _LastError, nResult );
   int nSize = ArraySize( tab );
   PrintFormat( "Size %d", nSize );
   for( int i = nSize - 1; i >= 0; i--)
      tab[i] = i;
};
 
Fernando Carreiro #:

Can you try making a completely new file with just that code and testing it? Maybe there is some hidden unicode characters which are causing a problem.

I used the following isolated code (for a Script) and I was unable to replicate your issue. Can you try it on your end please?

it is working on new file, but like i told you, the name "tab" is never used on any part on the code.

and i no libraries and no includes on the code.

what could it be else?

 
Issam Kadhi #: it is working on new file, but like i told you, the name "tab" is never used on any part on the code. and i no libraries and no includes on the code. what could it be else?

I gave you a possible reason — hidden Unicode characters. I've had that problem before twice, due to corruption of the source code file.

I resolved it by using an external text editor to save it a strictly 7-bit ASCII character format and then resaving it again to a normal UTF-8 format.

However, I cannot say it is your case. Something else could be causing it but without access to the full source code, I can only speculate.

Also, try using the debugger to see if you can spot a problem.

EDIT: Attention — 7-bit ASCII will be OK if you only use standard English, but if you use any other language with special character sets, then ASCII-7 will strip away those characters.

 
Fernando Carreiro #:

I gave you a possible reason — hidden Unicode characters. I've had that problem before twice, due to corruption of the source code file.

I resolved it by using an external text editor to save it a strictly 7-bit ASCII character format and then resaving it again to a normal UTF-8 format.

However, I cannot say it is your case. Something else could be causing it but without access to the full source code, I can only speculate.

Also, try using the debugger to see if you can spot a problem.

EDIT: Attention — 7-bit ASCII will be OK if you only use standard English, but if you use any other language with special character sets, then ASCII-7 will strip away those characters.

the strange thing, that when i use it on demo or live account, it works right.

last thing i can say: i hope that the community changes the development companies of mt4 and mt5. so stupid errors on both mt5 and mt4.

 
Issam Kadhi #: the strange thing, that when i use it on demo or live account, it works right.

Then there is more reason to believe that something else in your code is wrong and causing the trouble.

Issam Kadhi #: last thing i can say: i hope that the community changes the development companies of mt4 and mt5. so stupid errors on both mt5 and mt4.

What are you talking about?

What does this have to do with differences with MT4 and MT5?

There is nothing stupid about these errors. Something is clearly wrong in the code.

 
Fernando Carreiro #:

Then there is more reason to believe that something else in your code is wrong and causing the trouble.

What are you talking about?

What does this have to do with differences with MT4 and MT5?

There is nothing stupid about these errors. Something is clearly wrong in the code.

i have experience about 8 years coding on mql4/5, and there are a lot of coders who noticed same thing.

community should look into its coders of mt4/5, compilators are fake, worst compilators in the world.

simple two things happening usually: you write print() on line 139 for example, the ea gives results, but if you put print() on line 140, ea will give another results. this on mt5.

you should compilate the code on mt5 3 times to maybe receive real results......

now i noticed that even mt4 became fake.

 
Fernando Carreiro #:

Then there is more reason to believe that something else in your code is wrong and causing the trouble.

What are you talking about?

What does this have to do with differences with MT4 and MT5?

There is nothing stupid about these errors. Something is clearly wrong in the code.

now it worked

now it works when i turned double to string.

do you believe that it is stupid error now, fake compilators.

 
Issam Kadhi #: i have experience about 8 years coding on mql4/5, and there are a lot of coders who noticed same thing. community should look into its coders of mt4/5, compilators are fake, worst compilators in the world. simple two things happening usually: you write print() on line 139 for example, the ea gives results, but if you put print() on line 140, ea will give another results. this on mt5. you should compilate the code on mt5 3 times to maybe receive real results...... now i noticed that even mt4 became fake.

You are ranting!

Putting aside the quality of the Editor or Compiler, most of the time, problems encountered are due to the users not coding correctly.

Except for a few occasions of known actual MQL bugs, most of the problems I have faced have been due to my own mistakes, not the compiler's.

 
Issam Kadhi #: now it works when i turned double to string. do you believe that it is stupid error now, fake compilators.

No, I continue to believe it is a problem with your code and not the compiler. But without your total code, neither of us can prove their point of view.

 
Fernando Carreiro #:

No, I continue to believe it is a problem with your code and not the compiler. But without your total code, neither of us can prove their point of view.

d

d

i hope now you discovered that the coders of mt4 are funny, i hope they leave the community and find another work, not programming please!

Reason: