Download MetaTrader 5

Why? - page 2

To add comments, please log in or register
Ernest Klokow
1111
Ernest Klokow  

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope

qjol
3243
qjol  
GumRai:

It is probably the code prior to your posted code

If it has one too many "}"

Then you will get that error


i agree with "GumRai"
Keith Watford
Moderator
10564
Keith Watford  

Ernest,

Try Tools\Options\General and tick the "Highlight matching brackets" box

Makes finding errors like this much easier :)

Alain Verleyen
Moderator
32429
Alain Verleyen  
ernest02:

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope

The problem is, as said, that you made an error in the placement of your for loop code.

You need to copy and paste more code here if you can't find the problem.

Carl Schreiber
7096
Carl Schreiber  
ernest02:

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope


For those missing ( or ) or { or } I use(d) Notepad++ it can count the brackets to show 'un-equalness' this way.

But the new mt4 editor has better tools for that: Tools->General->enable matching brackets - it easier to see where the {} do not fir.

Gooly

Ernest Klokow
1111
Ernest Klokow  

I found the bloody culprit! I had 46 "{" and 47 "}".

THANKS FOR ALL THE HELP GUYS!!

12
To add comments, please log in or register