Frenchytrader: It says 'SplitString' and 'ArraySize' - declaration without type. But it is coded like this into many EAs. int init() { SplitString(PipsDeclencheur,";", PipsDeclencheurArray); SplitString(StopLossToSet,";", StopLossArray); int maxSize = ArraySize(PipsDeclencheurArray); ArrayResize( PipsDeclencheurArrayValue, maxSize); ArrayResize( StopLossArrayValue, maxSize); : } | Because no EA is coded like that. Missing open/close braces. |

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
Hi,
Why when I tried to copy something working into another EA... It doesn't work.
Please Help.
It says 'SplitString' and 'ArraySize' - declaration without type.
But it is coded like this into many EAs.
int init()
SplitString(PipsDeclencheur,";", PipsDeclencheurArray);
SplitString(StopLossToSet,";", StopLossArray);
int maxSize = ArraySize(PipsDeclencheurArray);
ArrayResize( PipsDeclencheurArrayValue, maxSize);
ArrayResize( StopLossArrayValue, maxSize);
At the end of the EA, I have this function:
bool SplitString(string stringValue, string separatorSymbol, string& results[], int expectedResultCount = 0) {
if (StringFind(stringValue, separatorSymbol) < 0) {
ArrayResize(results, 1);
results[0] = stringValue;
} else {
int separatorPos = 0;
int newSeparatorPos = 0;
int size = 0;
while(newSeparatorPos > -1) {
size = size + 1;
newSeparatorPos = StringFind(stringValue, separatorSymbol, separatorPos);
ArrayResize(results, size);
if (newSeparatorPos > -1) {
if (newSeparatorPos - separatorPos > 0) {
results[size-1] = StringSubstr(stringValue, separatorPos, newSeparatorPos - separatorPos);
}
} else {
results[size-1] = StringSubstr(stringValue, separatorPos, 0);
}
separatorPos = newSeparatorPos + 1;
}
}
if (expectedResultCount == 0 || expectedResultCount == ArraySize(results)) {
return (true);
} else {
return (false);
}
}