Access Global Variables for array?

 
Hi
Is there a way to save an array in Global Variables? I don't think MT4 has that ability.

Any alternatives to access a Global (alike) array by multiple EAs?
Thanks
Pankaj
 
If you want to "save" consider saving/reading a file.
 
mittalpa wrote >>
Hi
Is there a way to save an array in Global Variables? I don't think MT4 has that ability.

Any alternatives to access a Global (alike) array by multiple EAs?
Thanks
Pankaj

I wrote a library to do this. However it is a little overcomplicated. Anyway you can write one value in one global variable plus some index, so you may handle array in this way.

#define GlobalDiv "."

// Write data structure into 'name' global variable
bool WriteGlobal(string name, double value, int param1=0, int param2=0, string s="")
{
   string id=StringConcatenate(name,GlobalDiv,param1,GlobalDiv,param2,GlobalDiv,s);
   return(GlobalVariableSet(id, value)>0);
}

Reading is a little more tricky if you add string...

Hope this helps.

Reason: