Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1394

 

I get a 4014 error in the service after calling SocketConnect().

What would that mean? Is SocketConnect() allowed in services?

 
leonerd #:

I get a 4014 error in the service after calling SocketConnect().

What would that mean? Is SocketConnect() allowed in services?

ok, forgot to add the address to the list of allowed in the terminal settings.

 
Yes, these services are such a pain to debug. They don't kill themselves. You stop debugging and that's it - you can't debug a second time.
 
leonerd #:
Yeah, those services are such a pain to debug. They don't kill themselves. You stop debugging and that's it - you can't debug a second time.

Who forbade debugging the code in the script and then transferring it to the service?

 
Alexey Viktorov #:

And who forbid debugging code in the script and then transferring it to the service?

Well, who likes these crutches )). But it worked fine the second time. I fired it up )))).

 

Please tell me, if I pass an object in an object array (CArrayObj), which is then destroyed (array), how do I save the object? From the description of FreeMode() for an array, it's not quite the same.

I want to ensure that after destroying a declared array of objects, the element added to it is not destroyed.

 
leonerd #:

Please tell me, if I pass an object in an object array (CArrayObj), which is then destroyed (array), how do I save the object? From the description of FreeMode() for an array, it's not quite the same.

I want to ensure that after destroying a declared array of objects, the element added to it is not destroyed.

Use FreeMode( false ).

 

Good afternoon, can you please help me figure this out to the end:

in the loop we get to 127 (0111111111), add 1, should get (10000000), i.e. 128, but since the first character is a sign, we get minus zero and it should loop from zero to 127 (0111111111), but according to logs after 127 goes minus 128. Minus 128 should be (1 10000000) but first unit can not fit in 8 characters and only (10000000) remains, it is either 128 without minus or minus zero.

 
Sergey #:

Good afternoon, please help me figure this out:

In the loop we come to 127 (0111111111), add 1, should turn out (10000000), i.e. 128, but since the first character is a sign, we get minus zero and should loop from zero to 127 (0111111111), and according to the log after 127 goes minus 128. Minus 128 should be (1 10000000) but the first unit can not fit into 8 characters and only (10000000) remains, it is 128 without minus or minus zero.

This is not an additional code you are describing, but an inverse direct code. There is indeed a "0" and a "-0", and the negative number looks exactly the same as the positive number, but with a leading "sign" one.

 
JRandomTrader #:

This is not an additional code you are describing, but an inverse code. There is indeed a "0" and a "-0", and a negative number looks exactly like a positive number, but with a leading "sign" one.

By additional code:

after iteration (0111111111) comes iteration (10000000) right?

(10000000)=127 or +128?

Reason: