1 registered members (flink),
767
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
create string array?
#483146
05/06/21 06:46
05/06/21 06:46
|
Joined: May 2015
Posts: 390 Czech Republic
Grat
OP
Senior Member
|
OP
Senior Member
Joined: May 2015
Posts: 390
Czech Republic
|
Hi,
how to create the string or char array?
string aSymbol[12]={"EUR/USD","USD/JPY","EUR/JPY","AUD/USD","NZD/USD","AUD/NZD","USD/CAD","GBP/USD","EUR/GBP","GBP/JPY","AUD/JPY","EUR/CAD"};
have
omegaData compiling............ Error in 'line 15: syntax error < string aSymbol[12]={"EUR/USD","USD/JPY","EUR/JPY","AUD/USD","NZD/USD","AUD/NZD","USD/CAD","GBP/USD","EUR/GBP","GBP/JPY","AUD/JPY","EUR/CAD"}; >.
|
|
|
Re: create string array?
[Re: Grat]
#483164
05/06/21 15:58
05/06/21 15:58
|
Joined: Sep 2009
Posts: 993 Budapest
Aku_Aku
User
|
User
Joined: Sep 2009
Posts: 993
Budapest
|
Variation 1
STRING* asymbol[12];
str_cpy(asymbol[0], "EUR/USD";
str_cpy(asymbol[1], "USD/JPY";
str_cpy(asymbol[2], "AUD/USD";
... and so on...
Variation 2
TEXT* asymbol = {
strings = ("EUR/USD","USD/JPY","EUR/JPY","AUD/USD","NZD/USD","AUD/NZD","USD/CAD","GBP/USD","EUR/GBP","GBP/JPY","AUD/JPY","EUR/CAD");
}
I'm not sure the syntax is totally OK, I wrote it without any editor, help or so.
Last edited by Aku_Aku; 05/06/21 16:00. Reason: maybe the syntax will be better
|
|
|
Re: create string array?
[Re: Grat]
#483166
05/06/21 16:34
05/06/21 16:34
|
Joined: May 2015
Posts: 390 Czech Republic
Grat
OP
Senior Member
|
OP
Senior Member
Joined: May 2015
Posts: 390
Czech Republic
|
my solution:
#define SYMBOLS "EUR/USD","USD/JPY","EUR/JPY","AUD/USD","NZD/USD","AUD/NZD","USD/CAD","GBP/USD","EUR/GBP","GBP/JPY","AUD/JPY","EUR/CAD"
string aSymbol[12];
...
...
if (is(FIRSTINITRUN)){
while(asset(loop(SYMBOLS))){
aSymbol[i]=Asset;
}
}
|
|
|
Re: create string array?
[Re: Grat]
#483173
05/07/21 07:24
05/07/21 07:24
|
Joined: Sep 2009
Posts: 993 Budapest
Aku_Aku
User
|
User
Joined: Sep 2009
Posts: 993
Budapest
|
If it works, something really new must be implemented in GS. Or is it a Zorro feature?
Last edited by Aku_Aku; 05/07/21 07:26.
|
|
|
|