Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 643

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon, can you please advise me on the compatibility of int and datetime types, if I'm not mistaken. If I am not mistaken, datetime is an integer representing the number of seconds elapsed from 0 hours of January 1, 1970, can I assign a value of TimeCurrent() to an integer variable and then compare it to a variable of datetime type?
the date can be twice as much, byte for byte
https://www.mql5.com/ru/docs/basis/types/casting
Good day, good day! Can you advise me please about compatibility of int and datetime types? If I'm not mistaken, datetime is an integer representing the number of seconds elapsed from 0 hours of January 1, 1970, can I assign a value of TimeCurrent() to an integer variable and then compare it to a datetime type variable?
Yes you can, but it's better to use ulong
Alas, I don't get it...
Please tell me.
This code will work in two ways
1.
2.
the date can be twice as many bytes
https://www.mql5.com/ru/docs/basis/types/casting
Yes, I read it and since I didn't see anything there about converting datetime type to integer, I asked the question here. And let's say if an integer is type ulong, will it have enough bytes to host the time without loss? I will explain why this hassle. I just have a two-dimensional array, which stores integer data and need to add date to it.
datetime is ulong
If you mean the#property library property
I've got it checked...
Without it the library file doesn't even compile.I'm going to smoke so I don't write too abruptly and try to explain to you what #property strict is.
Don't bother.
I understand that you cannot help me.
I took out #property strict, I took out all the properties except#propertylibrary
nothing works.
Try plugging in my construct, find the error,
and post the correct code if that's the problem.
This code will work in two ways
1.
2.
Alas, neither option works
This code will work in two ways
1.
2.
You should not have corrected his code at once, the man just doesn't understand elementary compiler keys, and to write a normal code you need to know these subtleties and use documentation!
I pointed out to him that the video was very old; otherwise he would have copied it exactly as it was in the video and everything would have turned out well. But he got offended and complained, and as a result the post was deleted, while he is not even going to look into it!
Alas, none of the options work