Function definition unexpected. help please - page 2

 

huckleberry, you should start with a simple, basic programm in any language.

you have really no clue what programming and syntax means.

register in a forum like "programming for newbies", to understand the basic concept of a programming language.

or buy a book like "programming for newbies", should be avaiable below 20$.

all that you learn in such a book fits although to mql4.

 

Hi Huckleberry,

This is not to underestimate you, but seniors are right. Take it real slow. Try this link (2nd time i posted it today). Hope it's useful


regards

 

I'm not suprised he is having those problems the mql4 book and documentation sucks in this respect. There is no proper explanation of the use of parenthisis or braces in any of the documentation I have read, if I hadnt already learned the usage of these in other programming languages which did have proper explanation of their syntax in their documentation I would probably be having eactly the same problems as huckelberry.

 
cloudbreaker:

Looks like you haven't understood the concept of code-blocks and the use of braces.

For example, you have not enclosed the entire Close_Open_Sell() code-block in braces.

I seem to remember Gordon asking you to read the documentation on this very topic. That was good advice

>>>>

MQL4's 'Longest term NuB' )< 8) here looking for that reference. I understand the concept of Scope and how the braces relate to that.

But oblivioulsy not how, where, when and why I can and cannot place new function definitions. Some of the links refereed to here and in other threads are dead now, so any links to valid one are appreciated.

 

FourX:

MQL4's 'Longest term NuB' )< 8) here looking for that reference. I understand the concept of Scope and how the braces relate to that.

But oblivioulsy not how, where, when and why I can and cannot place new function definitions. Some of the links refereed to here and in other threads are dead now, so any links to valid one are appreciated.

This is what you don't do . . .

int start()
   {
   int VariableA, variableB;
   double VariableC, VariableD;
   
   int MyFirstFuntion(double MyFuncZ)  //  <-- user defined Function
      {
      int MyFuncA, MyFuncB;
      .
      .
      .
      return(MyFuncB);
      }
   
   VariableC = MyFirstFuntion(VariableD);
   return;
   }

This is what you do . . .

int start()
   {
   int VariableA, variableB;
   double VariableC, VariableD;
   
   VariableC = MyFirstFuntion(VariableD);
   return;
   }
   
int MyFirstFuntion(double MyFuncZ)  // <--  user defined Function outside the start function
      {
      int MyFuncA, MyFuncB;
      .
      .
      .
      return(MyFuncB);
      }
 
FourX:
cloudbreaker:
  1. Hijacking a 2 1/2 year old post
  2. Double posting AGAIN
  3. Not posting relevant questions
  4. Now go away you troll https://www.mql5.com/en/forum/138989/page5#633970 and thief https://www.mql5.com/en/forum/134317

RaptorUK:
Please do not feed the troll.
When you respond, you give the troll power. When you ignore the troll, he starves for attention and eventually dies.