Does + no longer work as a stiring concatenator in MQL4?

 

I am using the following lines of code outside of the init, deinit, and start functions and I am receiving the following error for the first line: 'RScriptPath' - expression on global scope not allowed, and the following errors for the second line: '+' - comma or semicolon expected, and, 'CallRScript' - variable not defined. I have used this same statement in other EA's that I have been able to compile and run just fine so I have no idea what is wrong. Maybe the syntax of MQL4 has been changed since my last compile (December 2012).


string RScriptPath = "\"C:/Program Files/R/R-2.15.2/CustomFunctions/CointegrationEA.R\"";
string CallRScript = "source(" + RScriptPath + ")";


Any help is appreciated. Thanks.

 
Global scope means you have incorrect braces {} or parentheses () before that line
like
int start(){
  if(condition)
     someStatement(s);
  }
  if(condition2) // this line will not compile
     :
}
Reason: