MQL5's issue with calling functions :')' - expression expected test.mq5 136 55

 

MQL5 seems to be having some issues with calling functions, despite correctly not only including the the file with which the function is situated in

#include <RunDiagnostics.mqh>

but I have also correctly instanted the required variables, or in this case, no variable needs to be passed.

Having been using MQL4 for the past 10 years, I'm really beginning to think that Metaquotes did not think this through when they released MQL5. It constantly returns non-existent errors. No, I have not just copied and pasted from MQL4 to MQL5 but these sorts of error should just not exist, as everything that MQL5 needs is present.

What other expression is this expecting exactly? Does this thing need its eyes tested, as clearly it cannot see the blatantly obvious semi-colon at the end of the function call.

//mq5
#include <RunDiagnostics.mqh>

void OnTick(){

        RunDiagnostics();

}


#mqh
void RunDiagnostics(){
                                                            
   ///function

   return;

}


Even tried

//mq5
#include <RunDiagnostics.mqh>

void OnTick(){

        RunDiagnostics(void);

}

Nope, that's not good enough for it either, all I get is:

'void' - illegal use of 'void' type     test.mq5        152     49
'(void*)' - operand expected    test.mq5        152     48

Seriously, what is this thigs problem?



Utterly ridiculous. 

 
TheFlyingPrussian:

MQL5 seems to be having some issues with calling functions, despite correctly not only including the the file with which the function is situated in

but I have also correctly instanted the required variables, or in this case, no variable needs to be passed.

Having been using MQL4 for the past 10 years, I'm really beginning to think that Metaquotes did not think this through when they released MQL5. It constantly returns non-existent errors. No, I have not just copied and pasted from MQL4 to MQL5 but these sorts of error should just not exist, as everything that MQL5 needs is present.

What other expression is this expecting exactly? Does this thing need its eyes tested, as clearly it cannot see the blatantly obvious semi-colon at the end of the function call.



Even tried

Nope, that's not good enough for it either, all I get is:

Seriously, what is this thigs problem?



Utterly ridiculous. 

where is the include file located ?

does the compiler acknowledge its inclusion?

        RunDiagnostics(void);    <=  don't put void there
 
Paul Anscombe #:

where is the include file located ?

does the compiler acknowledge its inclusion?

The include file is located at the top of the EA, yes it does acknowledge its there, and yes I am now aware as to not to pass "void".

 
  1. Why did you post your coding question in the MT5 Trading Systems (the strategy category) instead of the MT5 EA section (non-indicator coding)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. I have moved this thread.

  2. TheFlyingPrussian #: The include file is located at the top of the EA, yes it does acknowledge its there, and yes I am now aware as to not to pass "void".

    Wrong. If it is at the top of the EA code, then it's not an include file. An include file is a separate file.
              Be precise and informative about your problem

    Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.

    We can't see your broken code.

    Always post all relevant code (using Code button) or attach the source file.