Errors, bugs, questions - page 830

 
Koshi:
Can you be specific about this sending point?
Servicedesk.
 
Good afternoon! I'm writing a function, but the compiler is getting an error. I definitely haven't written this function before, I haven't written anything in time yet. I almost don't understand what the compiler is swearing at all.
int DayOfWeek()
  {
   MqlDateTime tm;
   TimeCurrent(tm);
   return(tm.day_of_week);
  }                                
'DayOfWeek' - function already defined and has body Redo.mq5 2698 6
 
And if this function is already present in MQL5, why isn't it immediately highlighted in blue? Or how else should I understand it? And where is it in the help?
 
Yes, absolutely right , 'DayOfWeek' - the function, already defined and, has a body Redo.mq5 2699 6
 
Dimka-novitsek:
Afternoon! I'm writing a function and the compiler is swearing. I definitely haven't written this function before, I haven't written anything by time yet. I almost don't understand what the compiler is swearing at all.'DayOfWeek' - function already defined and has body Redo.mq5 2698 6

I don't get a swear word, although I usually apply the second type of time in the structure.

Script:

void OnStart()
  {
    Print("f1=",DayOfWeek(),"    f2=",DayOfWeek2());

  }
//+------------------------------------------------------------------+
int DayOfWeek()
  {
   MqlDateTime tm;
   TimeCurrent(tm);
   return(tm.day_of_week);
  }
//+------------------------------------------------------------------+
int DayOfWeek2()
  {
   MqlDateTime tm;
   TimeToStruct(TimeCurrent(),tm);
   return(tm.day_of_week);
  }
//+------------------------------------------------------------------+

 

The most amazing thing is that it doesn't say there's an error, but that the function is already defined and the body is there!!! Noooo, noooo!!!!!

Thanks for the example.

 
 
Dimka-novitsek:
The most amazing thing is that it doesn't say there's an error, but that the function is already defined and the body is there!!! noooo,noooo!!!!!
What do you mean, no?
 
EQU:

>about round

Cut off the fractional part from the trillion... Yes.. It's important!!! )))))

If not int, at least long, eh?;)

I understand your indignation. But no one is preventing you from feeding a number like DBL_MAX or something close to it to the input. What will we get as a result? A 1024-bit integer?
 

I mean, the compiler swears there is one. Or did I misunderstand it, the compiler?

Not in the sense that I didn't write it before. Yeah. Thought I was dumb. But what could it be?

Reason: