A question for MQL experts - page 5

 

Good afternoon,

a question for connoisseurs... I need a time calculator (here's an example of what it should count 2011.03.06 17:20 +23652min = date and time)

who can help me write such a calculator?

 
IgorM:

is it https://www.mql5.com/ru/forum/103244 or https://www.mql5.com/ru/forum/107925 not helpful?

forum search works today, lots of information on https://www.mql5.com/ru/search


Something cleared up. Thank you, Igor!
 
psycoma:

Good afternoon,

a question for connoisseurs... I need a time calculator (here's an example of what it should count 2011.03.06 17:20 +23652min = date and time)

Who can help me write a calculator?

TimeToStr((StrToTime("2011.03.06 17:20")+23652*60))

Translate it into seconds, add it up and back into a line.

 

Good afternoon.

Here is the function code:

int getNextOrderNum(int RRRR) {
   switch (RRRR) {
   case 101:
      return (102);
   case 102:
      return (103);
   case  103:
      return (104);

                 }
   return (0);
}
... ... ...

If I set numbers (101-102-103-104 .... ), it's fine.

When I set Magic_101, Magic_102, Magic_103,..... instead of numbers - I get errors on compilation:

'Magic_101' - integer number expected

'Magic_102' - integer number expected....

Please tell me what's wrong ?

(It's someone else's code - at my friend's request I'm pasting magic numbers into global variables instead of the numeric ones in the code)

 
You can't put a variable in case, only a numeric constant.
 
What can be done to avoid compilation errors?
 
Rita:

Good afternoon.

Here is the function code:

If I set numbers (101-102-103-104 .... ), it's fine.

When I set Magic_101, Magic_102, Magic_103,..... instead of numbers - I get errors on compilation:

'Magic_101' - integer number expected

'Magic_102' - integer number expected....

Please tell us what's wrong.

(someone else's code - I'm pasting into someone else's EA of magic - instead of given in the code numeric - in glob. variables)

What you wrote doesn't satisfy you? It clearly and bluntly says that int

A thong is on girls, not tags. At least in this incarnation of S.

 
Convert the switch to a bunch of ifs
 
TheXpert:
Convert the switch to a bunch of ifs
Excessive braking. I don't know how Mocle's byte-machine works, but it's terribly slow on conditions.
 
It's not a matter of choice, Peter, the switch won't compile.