Errors, bugs, questions - page 2501

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
This is what happens.
tried it like this:
2019.07.07 18:31:02.708 tst (EURUSD,H1) 4294967295 4294967295 4294967295 4294967295
2019.07.07 18:31:02.708 tst (EURUSD,H1) A
2019.07.07 18:31:02.708 tst (EURUSD,H1) 0 4294967295 4294967295 4294967295
2019.07.07 18:31:02.708 tst (EURUSD,H1) B
2019.07.07 18:31:02.708 tst (EURUSD,H1) 0 4294967295 4294967295 4294967295
2019.07.07 18:31:02.708 tst (EURUSD,H1) sizeof(A) = 4 , sizeof(B) = 4
we still only zero out the first 4 bytes
tried another way:
still no result - only clears the first 4 bytes
still no result - only clears the first 4 bytes
Because physically the structure is of 4 bytes.
Because physically the structure is 4 bytes.
yes, we already figured out that pack() doesn't work inside MQL - I don't have any more options to checkpack()
I thought about checking in .dll in C# but there's a problem there too - MQL sees the signature of the called function (remember the const call in signatures didn't work for C# )
and when transferring data to C# will it be possible to do type conversion?
ZS: at most, write a .dll in C++ - there you can "clean" data to receive / send
I don't remember if it's in the documentation.
Thank you, I found it. Everything works in my opinion. Since in your example there is only one type in the structure, there is no point in alignment. That's why it only gives the size of the type. And here you have
Here is the structure
The documentation explains it very clearly in pictures.
Thank you, I found it. Everything works in my opinion. Since in your example there is only one type in the structure, there is no point in alignment. That's why it gives only type size. And here we have
And this structure
The documentation explains it very clearly in pictures.
Yes, that's how it works:
2019.07.07 19:16:27.100 tst (EURUSD,H1) 4294967295 4294967295 4294967295 4294967295
2019.07.07 19:16:27.100 tst (EURUSD,H1) A
2019.07.07 19:16:27.100 tst (EURUSD,H1) 0 0 0 0 4294967295
2019.07.07 19:16:27.100 tst (EURUSD,H1) B:
2019.07.07 19:16:27.100 tst (EURUSD,H1) 0 0 0 0
2019.07.07 19:16:27.100 tst (EURUSD,H1) sizeof(A) = 12 , sizeof(B) = 16
total: pack() performs data alignment in the structure by the size of the maximum sizeof() field of the structure
summary: pack() aligns data in the structure by the size of the maximum sizeof() field of the structure
Not exactly.
The maximum field is 8 bytes; we set alignment at 4 and get 16. That is 2+2|4|2+2|2+addshort doubleint
Or 2+addition|4|4|4
Not exactly.
The maximum field is 8 bytes, set the alignment to 4 and get 16. So 2+2|4|2+2|2+add short doubleint
Or 2+addition|4|4|4
yes, that should probably sound right:
summary: pack() performs element by element alignment of data in the structure; each element will be appended with a value multiple of pack() taking into account the maximum sizeof() of the structure element (no more than the maximum value, less may be in appending)
pack(4) :
short = 2 + 2 appended = 4=pack(4)
double =8 - do not collapse
int =4 - not aligned
sizeof()=16 bytes
yes, that's probably how it should sound:
total: pack() performs data alignment in the structure element by element, each element will be a multiple of pack() taking into account the maximum sizeof() of the structure element (no more than the maximum value, less may be in addition)
pack(4) :
short = 2 + 2 appended = 4=pack(4)
double =8 - do not collapse
int =4 - not aligned
sizeof()=16 bytes
It sounds convoluted, but it makes sense to me.))
Sounds convoluted, but makes sense to me.)))
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
fxsaber, 2019.07.07 15:03
Theorder of the fields affects memory consumption and apparently performance.
Haven't been able to fully understand it yet.