I'll ask the service desk..
gooly:
I'll ask the service desk..
If you ask them "how", they will froward you here and/or give you a link to docs.
I'll ask the service desk..
Well this works so far:
void OnStart() { //--- struct TradeSet { string symb;// = "xxxYYY"; // GBPUSD }; TradeSet arr[3]; int i; for(i=0;i<3;i++){ arr[i].symb = "Test "+(string)i; } string x; for(i=0;i<3;i++){ x = x+"\n"+arr[i].symb; } Comment(x); }
But I'd like to initialize the string-values but the compiler refuses this :(
Ovo:
If you ask them "how", they will froward you here and/or give you a link to docs.
If you ask them "how", they will froward you here and/or give you a link to docs.
Well in the ref is nothing about this way of using :(
gooly:
Well this works so far:
But I'd like to initialize the string-values but the compiler refuses this :(
I am not sure, what you mean by "initialize string-values". This?
struct TradeSet { TradeSet() : symb("xxxYYY"){} string symb;// = "xxxYYY"; // GBPUSD };
or
TradeSet arr[] = {{"x"},{"y"},{"z"}};
Normal variables I can initialize at their definition:
int x = 1;
And I would prefer to be able to do this as well:
struct TradeSet { string symb = "xxxYYY"; // GBPUSD };
But your way is the intention and may be the only way.
Gooly
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In the reference of MQL4 I find the basic DataTypes and I can define array of theses types but a reference or pointers to structs is not mentioned there.
Can I define an array of references to e.g. struckts and how should I do this?
An array of handles has to be defines as an array of int.
Gooly