Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
type name[] = { CONSTANT1, CONSTANT2 ...};
you're not using constants but variables.
Thankyou,
I didn't realise that the values had to be constants.
So the only option is the long winded way :(
Thankyou,
I didn't realise that the values had to be constants.
So the only option is the long winded way :(
Hey folks! Thanks so much you have solved it.
I think raptors fix stating the string array[] ={ ''aaa", "bbb"}; must be used at Global variable define time,
should be added to the Help code on arrays on the platform. Following that you just index each element "string result=array[0];"
I just could not find "string arrays defined" anywhere on Google that then compiled, let alone on MT4 forum.
I eventually heavy coded the separate indexed move procedure as below which works. Thanks everyone.
int ac=0, numarray[3]; string symchart, symarray[3]; // load array elements seperately symarray[ac] = "EURGBP"; numarray[ac] = 1; ac++; symarray[ac] = "USDCHF"; numarray[ac] = 2; ac++; symarray[ac] = "USDJPY"; numarray[ac] = 3; symchart=symarray[2]; Print("element 3 index 2 gives = "+symchart+"); // prints USDJPYThankyou,
very useful piece of code, but I had to change temp+= because it wouldn't compile.
but I don't see how this relates to my post