Very strange: a line of code does nothing despite not being commented - page 2

 
The only explanations left are, in decreasing order of likelihood: a MT4 bug, a Windows bug, a hacker... or my computer is possessed by a demon.
 
mt4ski:
The only explanations left are, in decreasing order of likelihood: a MT4 bug, a Windows bug, a hacker... or my computer is possessed by a demon.

And of course, there is another explanation.

The code that you are testing is not the code that you have posted.

 
Keith Watford:

And of course, there is another explanation.

The code that you are testing is not the code that you have posted.

It doesn't matter if I changed the names of the functions.
 
mt4ski:
It doesn't matter if I changed the names of the functions.

just post the whole code already..... so the error can be found

the most logical scenario is that you are calling okay() from elsewhere in your code and not from the function with BEGIN in it....

 
mt4ski:
The only explanations left are, in decreasing order of likelihood: a MT4 bug, a Windows bug, a hacker... or my computer is possessed by a demon.

Yeah, you forgot one thing: cosmic radiation.

Your computer is located on path of a stream of high energy (still unknown) particles flowing from some star that exploded billion years ago.

Try moving your PC to another room. Tin foil might also help (on a computer, not on your head).

 
Paul Anscombe:

just post the whole code already..... so the error can be found

the most logical scenario is that you are calling okay() from elsewhere in your code and not from the function with BEGIN in it....

   Sorry but my issue cannot be explained with more clarity. Introducing irrelevant code won't help at all.

   But because I'm patient with you guys...

   There is only one strange() function, and a message is printed indicating that it was called.
   It doesn't matter from where it is called: "BEGIN" should be printed but is not. 

   I didn't expect anyone to be able to help anyway...

 
Drazen Penic:

Yeah, you forgot one thing: cosmic radiation.

Your computer is located on path of a stream of high energy (still unknown) particles flowing from some star that exploded billion years ago.

Try moving your PC to another room. Tin foil might also help (on a computer, not on your head).

  Don't mock me. Have you not seen how strangely the above MQL4 code behaves ?

 
mt4ski:

  Don't mock me. Have you not seen how strangely the above MQL4 code behaves ?

It's not mocking, just a reasonable conclusion based on the code you posted.

Since we don't have complete test sample that reproduces your problem, we have to include all possible reasons. 

 

Your code

void okay()
{
   strange(); 
   Print("FUNCTION WAS CALLED");
}

void strange()
{
   Print("BEGIN");
   
 // remaining code 
}

okay();

Your code presented properly

int OnInit()
{
   okay();
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
}
//+------------------------------------------------------------------+
void OnTick()
{
}
//+------------------------------------------------------------------+
void okay()
{
   strange();
   Print("FUNCTION WAS CALLED");
}
//+------------------------------------------------------------------+
void strange()
{
   Print("BEGIN");
// remaining code
}
//+------------------------------------------------------------------+

Result

0 17:53:14.917 Empty USDJPY,H1: BEGIN

0 17:53:14.917 Empty USDJPY,H1: FUNCTION WAS CALLED

0 17:53:14.917 Empty USDJPY,H1: initialized

As I said, the problem is that you are not testing the code that you have posted.

 
Keith Watford:

Result

0 17:53:14.917 Empty USDJPY,H1: BEGIN

0 17:53:14.917 Empty USDJPY,H1: FUNCTION WAS CALLED

0 17:53:14.917 Empty USDJPY,H1: initialized

As I said, the problem is that you are not testing the code that you have posted.

As there has been no further reply from the OP we can only assume that he was testing different code.

Reason: