Download MetaTrader 5
To add comments, please log in or register
They are already making profit from their signals. Publish your signal and join them!
G.M
37
G.M 2014.11.11 22:15 

Hello,

 how can initialize an array of string? If i use command ArrayInitialize(s,".") i get error :

ArrayInitialize - no one of  the overloads can be applied to the function call.

 Thanks in advance 

whroeder1
13619
whroeder1 2014.11.11 22:22  
G.M: how can initialize an array of string? If i use command ArrayInitialize(s,".")
  1. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
  2. void ArrayInitializeString(string& A[], string init=""){
      for(int iPos = ArraySize(A) - 1; iPos >= 0; --iPos) A[iPos] = init;
    }
    What that so hard?
G.M
37
G.M 2014.11.12 05:34  
Sorry but I do not understand how angry your answer.
According to the official documentation on the function ArrayInitialize does not seem possible to directly initialize an array of strings.

I pointed to the part of my code related to my problem:

double sprd[116], swpL[116], swpS[116];
string s[116];

..... 

ArrayInitialize(sprd, 99);
ArrayInitialize(swpL, -99);
ArrayInitialize(swpS, -99);
ArrayInitialize(s, ".");

I was wondering if you could answer the question about initialize of an array of strings with an existing function.
From your answer I assume not, but I still wonder why it is not possible.

I take the trouble.
/
To add comments, please log in or register