How can set this variable value to array

 

I try to set suffix value to currency string

I have this code

//========================
extern string suffix = "";
//========================
string EURAUD = "EURAUD"+suffix ;
string EURCAD = "EURCAD"+suffix;
string EURCHF = "EURCHF"+suffix;

 try to replace this value to this array

string EUR[7] = {"EURAUD","EURCAD","EURCHF"};

 as follow

string EUR[7] = {EURAUD,EURCAD,EURCHF};

as you know constant value cannot set in array .

So how can set this value to get result

I want to add suffix string from dialog box when run this code

 
sinput string InpSuffix = ""; // Currency Symbol Suffix

string Pairs[] = { "EURAUD","EURCAD","EURCHF","..." };

int OnInit()
 {
   if(StringLen(InpSuffix))
    {
      for(int i=0; i<ArraySize(Pairs); i++) Pairs[i] += "." + InpSuffix;
    }
 
lippmaje:

Code will not work for EAs. If user changes symbol or timeframe, EA goes through a deinit-init cycle. It is not reloaded. The array ends up “EURAUD.x.x.x.x.x”

 

Yep. Fix to this:

sinput string InpSuffix = ""; // Currency Symbol Suffix

string Pairs[];

int OnInit()
 {
   string pairs[] = { "EURAUD","EURCAD","EURCHF","..." };

   if(StringLen(InpSuffix))
    {
      for(int i=0; i<ArraySize(pairs); i++) pairs[i] += "." + InpSuffix;
    }
   ArrayCopy(Pairs,pairs);