1.
have u studied: MQL4 Reference - Basics - Variables - Initialization of variables
specifically: "All arrays, including those declared in the local scope, can be initialized with constants only."
2.
wat above means is that u can declare array: string a[2][3];
now... in 'code' u assign values to each array element as required
eg, a[0][0]=Int1;
3.
but... variable Int1 is type int, how able assign to variable of type string?
look at MQL4 Reference - Basics - Data types - Type casting
4.
string a[2][2] = { "PString1", "SString1", "PString2", "SString2"}; //no error but wrong result obviously
above works because via 1., are constants
to get contents/value of PString1,... into array element eg, a[0][1]=SString1;
.
maybe this help u get onto path?
Thanks, fbj, I found it shortly after posting and meant to come back and edit it. It is annoying because actually that list will be 96 variables long (36 * 3)!
Hopefully we will be allowed to Initialise with variables in MQL5
The Int is handled by DoubleToString(Int1,0) and then converting back on retrieval.
well, u sorted, good...
could always keyinto ini .txt file and read into array with FileReadString()..
then ez to mod entries etc.
just top of head comment :)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wish to place external variables in an array.
I have tried this:
Any ideas?