Maybe because pair[] exists only within the brackets as it was declared there.
You have to declare once and outside the if..
BTW , is there a final } is missing at each line? No compiler error about this?
Maybe because pair[] exists only within the brackets as it was declared there.
You have to declare once and outside the if..
BTW , is there a final } is missing at each line? No compiler error about this?
thank you, i made a mistake with posting the code, there is no { before string, so no error there.
I did declare the pair[] outside the if statement in the global variables section, with string pair[]; it replaced the error with repeated warnings : declaration of 'pair' hides global declaration at line XX and still continues to give the 1st warning of variable 'pair' not used.
Maybe because pair[] exists only within the brackets as it was declared there.
You have to declare once and outside the if..
BTW , is there a final } is missing at each line? No compiler error about this?
I am trying to create a string array based on an ENUM that I created for a drop down list. The enum and drop down list work fine. When I create an Array based on the enum selected that's when I run into problems.
Whenever I compile it gives a warning saying variable pair is not used and then later an error saying pair is not declared. I have also tried changing "Currency==USD" to ==0, and used EnumtoString and even IntegerToString. Any help on this would be fantastic. I'm sure it's something very basic I'm over looking.
Because you need to remove the declarations ("string ...") inside your brackets. But anyway it will give other errors. I would suggest you to use a Two-dimensional array.
input ENUM_BASKET Currency=USD; string pair[][7]= { {"EURUSD","GBPUSD","AUDUSD","NZDUSD","USDCAD","USDCHF","USDJPY"}, {"EURUSD","EURGBP","EURAUD","EURNZD","EURCAD","EURCHF","EURJPY"}, {"GBPUSD","EURGBP","GBPAUD","GBPNZD","GBPCAD","GBPCHF","GBPJPY"}, {"USDJPY","GBPJPY","AUDJPY","NZDJPY","CADJPY","CHFJPY","EURJPY"}, {"EURCAD","GBPCAD","AUDCAD","NZDCAD","USDCAD","CADCHF","CADJPY"}, {"EURAUD","GBPAUD","AUDUSD","AUDNZD","AUDCAD","AUDCHF","AUDJPY"}, {"EURNZD","GBPNZD","NZDUSD","AUDNZD","NZDCAD","NZDCHF","NZDJPY"}, {"USDCHF","GBPCHF","AUDCHF","NZDCHF","CADCHF","CHFJPY","EURCHF"} }; ... //--- Use pair[Currency][0..6]
Because you need to remove the declarations ("string ...") inside your brackets. But anyway it will give other errors. I would suggest you to use a Two-dimensional array.
- 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 am trying to create a string array based on an ENUM that I created for a drop down list. The enum and drop down list work fine. When I create an Array based on the enum selected that's when I run into problems.
Whenever I compile it gives a warning saying variable pair is not used and then later an error saying pair is not declared. I have also tried changing "Currency==USD" to ==0, and used EnumtoString and even IntegerToString. Any help on this would be fantastic. I'm sure it's something very basic I'm over looking.